[plt-scheme] srfi 0 or conditonal expansion

From: YC (yinso.chen at gmail.com)
Date: Wed Jun 6 10:21:10 EDT 2007

I see - thanks for the clarification ;)

On 6/6/07, Chongkai Zhu <czhu at cs.utah.edu> wrote:
>
> As you expected, the former (more likely one) happens.
>
> (require (lib "7.ss" "srfi"))
> (program (requires srfi-9)
>          (feature-cond
>           (else (code (define y 6)))))
> y
>
> => 6
>
> You are missing a "code" in the code.
>
> Chongkai
>
> YC wrote:
> > Thanks Chongkai for the suggestion.
> >
> > Looking at the doc it can only do conditional expansion based on
> > availability of srfi-x, so I would probably have to try to hack my own
> > solution based on the design.
> >
> > On the other hand, I seem to either have a misunderstanding of the
> > SRFI or come across a bug (I would assume the former is more likely...
> > ;P):
> >
> > (require (lib "7.ss" "srfi"))
> > (program (requires srfi-9)
> >          (feature-cond
> >           (else (define y 6)))) ; should unconditionally provide the
> > feature
> > y ; expects 6
> > ; but results in error:
> > ; program: bad syntax in: (program (define y 6))
> >
> > Looking at program.ss it shows the following syntax-case:
> >
> >     ((_
> >       (feature-cond (else stuff ...))
> >       more ...)
> >      (syntax
> >       (program
> >        stuff ...
> >        more ...)))
> >
> > Shouldn't this be expanded to
> >
> > (syntax
> >  (begin
> >    stuff ...
> >    (program more ...)))
> >
> > ?
> >
> > Thanks,
> > yinso
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070606/30ff16fb/attachment.html>

Posted on the users mailing list.