chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Minor problem with args egg


From: Jim Ursetto
Subject: Re: [Chicken-users] Minor problem with args egg
Date: Wed, 13 May 2015 11:55:48 -0500

On Wed, May 13, 2015 at 4:52 AM, Peter Bex <address@hidden> wrote:
On Wed, May 13, 2015 at 03:38:41AM -0600, Matt Gushee wrote:
> Anyway, it seems that if you specify an option with no arguments, e.g.
>
>    (args:make-option (v version) #:none
>                               "Display compiled versions.")
>
> ... then when the user invokes the program with that option, you get:
>
>    '((v . #f) (version . #f))
>
> ... which means that alist-ref will not tell you whether the user passed
> that option, or it simply isn't present. I wonder if it wouldn't be better
> for a no-arg option to produce a symbol, #:undefined perhaps?

I would expect #t to be present if the user passed the option.  This
allows for easy presence-checking, and it's similar to an option that
accepts "yes" or "no".

#t does seem to make sense ... the existing behavior comes from the srfi-37 implementation which sets the value to #f for #:none args.  I could modify the args egg to change #f to #t in this case; I don't think this would cause any problems.  Will think it over tonight.

Jim

reply via email to

[Prev in Thread] Current Thread [Next in Thread]