I wanted to replace a bool in a struct opt with an AtomicBool and this didn't "just work". I suppose I have to write a custom parser for this, and pass it as a parse(...), but it would be nice if that would just work.
Looking at the docs, it is unclear to me how to do that. I basically want the same semantics as bool, e.g., if the flag is present, set it to true, and false otherwise, but it does not appear that this behavior can be achieved with custom parsers.
You're right, that's not possible now.
A new feature can be having a new parser:
|kind|signature|default|
|--|--|--|
| from_flag | fn(bool) -> T | From
@TeXitoi yes that sounds like it would allow me to solve my problem and allow others to solve problems similar to mine. Given that AtomicBool is in libcore, it might be worth adding support for it natively anyways.
There is a lot of types in libcore and libstd, and I prefer not to have magic around type name as the macro system doesn't have access to type resolving. That's why I prefer not handling AtomicBool explicitly.
I decided to take a stab at this in #271
Most helpful comment
There is a lot of types in libcore and libstd, and I prefer not to have magic around type name as the macro system doesn't have access to type resolving. That's why I prefer not handling AtomicBool explicitly.