[plt-scheme] srfi 0 or conditonal expansion

From: YC (yinso.chen at gmail.com)
Date: Tue Jun 5 19:55:04 EDT 2007

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

On 6/5/07, Chongkai Zhu <czhu at cs.utah.edu> wrote:
>
> According to http://srfi.schemers.org/srfi-implementers.html, PLT doesn't
> support SRFI 0. You can try SRFI 7 instead.
>
> Chongkai
>
> ----- Original Message -----
> From: YC
> To: PLT Scheme Mailing List
> Sent: Tuesday, June 05, 2007 4:56 PM
> Subject: [plt-scheme] srfi 0 or conditonal expansion
>
>
> Hi all -
>
> quick question:
>
> it seems like SRFI 0 is not part of the distro, so what is the correct way
> to do conditional expansion based on defined/available feature, or is it
> frowned upon?
>
> Thanks,
> yinso
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070605/43e7012d/attachment.html>

Posted on the users mailing list.