[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 22:31:46 -0500 |
> On May 13, 2015, at 11:55, Jim Ursetto <address@hidden> wrote:
>
> #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.
>
In args 1.5.1, #:none options now return a value of #t instead of the srfi-37
default of #f, so they are effectively booleans. This would also set up the
possibility for —no-xxxxxx options which set option ‘xxxxxx' to #f; naturally,
that is not yet implemented.
#:optional options will still return #f when an argument is not provided, since
it is not nice to explicitly test against #t to distinguish between argument
provided and not. Also, optional arguments should not be boolean in my
opinion. An argument value of #f allows you to implement a default of “1" by
placing this in the body:
(set! arg (or arg “1”))
Jim