iz v0.6.18 - Now with a modern, fast, @safe, getopt-like function

Basile B. b2.temp at gmx.com
Mon May 28 00:53:45 UTC 2018


Last time i promoted my stuff here there were two compiler/Phobos 
bugs preventing to activate this nice getopt-like function.

specs:

- It's based on UDA.
- It supports multiple locations for UDA-fied functions and 
variables.
- It doesn't use pointers, UDA-ified variable are accessed 
without intermediary.
- It's faster than the phobos one (although getopt is never a 
bottleneck)
- It's `@safe` and can be even `nothrow`

It could be easily added to phobos (just need to convert some 
EnumSet to BitFlag).

- code: 
https://github.com/BBasile/iz/blob/master/import/iz/options.d#L596
- DUB: https://code.dlang.org/packages/iz
- doc: 
https://iz.dpldocs.info/v0.6.18/iz.options.handleArguments.html
- cool demo: 
https://github.com/BBasile/Coedit/blob/master/dastworx/src/main.d#L18

Note that despite of the run-time compatibility mention in the 
README, this module is part of a subset of IZ that can be used 
without all the concept of Nogc as used in iz. (at some point i 
should split the twos parts).


More information about the Digitalmars-d-announce mailing list