guile-user
[Top][All Lists]
Advanced

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

Re: 1.5.6: (bound? ) missing from optargs.scm


From: Marius Vollmer
Subject: Re: 1.5.6: (bound? ) missing from optargs.scm
Date: 01 Apr 2002 00:59:57 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Thien-Thi Nguyen <address@hidden> writes:

> 2001-05-10  Marius Vollmer  <address@hidden>
> 
>       * optargs.scm (bound?): Removed.  We should not play games with
>       the magical undefined value.
> 
> i don't particularly understand what kinds of games are no longer being
> played, nor what is the suggested way to achieve prior functionality.

SCM_UNDEFINED is used in C code to flag a variable that exists but has
no value associated with it.  For example, 'letrec' first creates all
new local variables with SCM_UNDEFINED as their value, and any try to
read their value will result in an error.  It also used as a special
not-a-legal-Scheme-value token in C code, for example with scm_list_n.

When Scheme code gets access to it, and treats it like any other
Scheme value, a lot of assumptions in the C code break down.

The old (ice-9 optargs) used this value as the default default value,
i.e. the value to use as the default value when no explicit default
value was specified.

We can use any other unique default default value, for example the
result of '(cons* 'unbound)'.

It might be tempting to use the un_specified_ value, SCM_UNSPECIFIED,
instead of SCM_UNDEFINED, but that wouldn't be really right, either.
SCM_UNSPECIFIED is a perfectly usable Scheme value (which
SCM_UNDEFINED is not), but it is not really specific to this purpose:
you will get it from a lot of functions, and you would then not be
able to distinguish whether your keyword has not been specified at the
call side, or whether it has been specified but with the unspecified
value (which would likely be an error, but you wouldn't notice).



reply via email to

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