Could we add identifier-unbound? to Ikarus (and psyntax) - it looks
like it might be a good language extension for a future standard.

Do you know whether it has been discussed previously, in particular
whether there are any good reasons to omit such a predicate in the
language?

On Fri, Jun 19, 2009 at 9:26 PM, Derick
Eddington<[email protected]> wrote:
> On Fri, 2009-06-19 at 04:04 -0700, Derick Eddington wrote:
>> If a #'define, #'syntax, or #'ctxt, which is unbound or is bound to
>> something different than imported in the (b bound) library, is given,
>> then the first three checks will pass.  If it is unbound, the last check
>> will return #T because the same symbol in the lexical context of the
>> #'here is not bound (else one of the first three checks would have
>> already failed) and so the two identifiers are both unbound and so are
>> compared according to symbolic spelling.
>
> That's incorrect.  I was wrong, the new predicate is also broken:
>
> (import (except (rnrs) define)
>        (for (b bound) expand))
>
> (define-syntax if-unbound
>   (lambda (x)
>     (syntax-case x ()
>       [(_ (id) then else)
>        (if (unbound-identifier? #'id) #'then #'else)])))
>
> (if-unbound (define)
>  (display "define unbound\n")
>  (display "define bound (incorrect)\n"))
>
> $ IKARUS_LIBRARY_PATH=. ikarus --r6rs-script b/t2.sps
> define bound (incorrect)
> $ plt-r6rs ++path . b/t2.sps
> define unbound
> $ larceny --path . --r6rs --program b/t2.sps
> define bound (incorrect)
> $ ypsilon --sitelib . --r6rs b/t2.sps
> define bound (incorrect)
> $
>
>
> Drat.  I'm going to sleep now.
>
> --
> : Derick
> ----------------------------------------------------------------
>
>

Reply via email to