You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working on an application of mine, and reading the documentation
In the readme:
The :boolean/true option kind creates a flag, which always returns T.
The :boolean/false option kind creates a flag, which always returns NIL.
It's not entirely clear what the above means, for a couple of reasons. In particular, it doesn't make sense for these to always return anything. I imagine what is meant is that :boolean/true is going to create an option whose value will normally be nil, unless the user supplies the flag, in which case it will be t.
Being even more fussy: these options don't "return" anything so that's why I said "an option whose value will be" instead of "returns." I believe that "returns" is shorthand for "getopt on the option name will return".
Finally, there's some confusion about how to set the :initial-value of a flag, because it seems the initial value must be either :true or :false even though what getopt gives back is either t or nil. I tried supplying t and got a somewhat cryptic error message.
The text was updated successfully, but these errors were encountered:
The :boolean/true option kind creates a flag, which always returns T.
An example for this one might be an option such as --enable-engine, which when specified on the command-line will always be set to T. This is what the :flag option does internally.
The :boolean/false option kind creates a flag, which always returns NIL.
In a similar way the :boolean/false option does the opposite by setting the value associated with the option to NIL. For example --abort-on-errors option if specified might make decisions to continue with the program execution in case of errors.
These are just helper options around flags.
What you probably want to use is :boolean option which allows specifying a value. For example --enable-logging=false or --enable-logging=true.
I'd be happy to review and make changes to the documentation, if they are unclear, so feel free to propose such! :)
I was working on an application of mine, and reading the documentation
In the readme:
It's not entirely clear what the above means, for a couple of reasons. In particular, it doesn't make sense for these to always return anything. I imagine what is meant is that
:boolean/true
is going to create an option whose value will normally benil
, unless the user supplies the flag, in which case it will bet
.Being even more fussy: these options don't "return" anything so that's why I said "an option whose value will be" instead of "returns." I believe that "returns" is shorthand for "
getopt
on the option name will return".Finally, there's some confusion about how to set the
:initial-value
of a flag, because it seems the initial value must be either:true
or:false
even though whatgetopt
gives back is eithert
ornil
. I tried supplyingt
and got a somewhat cryptic error message.The text was updated successfully, but these errors were encountered: