[plt-scheme] srfi/42 filter doen't work

From: Jos Koot (jos.koot at telefonica.net)
Date: Wed Oct 29 06:23:05 EDT 2008

import if both from mzscheme and scheme/base;
call them if1 and if2:

(module x mzscheme
 (require (rename mzscheme if1 if))
 (require (rename scheme/base if2 if))
 (require-for-syntax syntax/stx)
 (require syntax/stx)
 (define-syntax (x stx)
  (syntax-case* stx (if1 if2) module-or-top-identifier=?
   ((_ if1) #'#t)
   ((_ if2) #'#t)
   ((_ else) #'#f)))
 (provide x))
(require 'x)
(x if) ; #t ok
(x 1) ; #f ok
(require scheme/base)
(x if) ; #t ok  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<==
(x 1) ; #f ok

Jos

----- Original Message ----- 
From: "Jens Axel Soegaard" <jensaxel at soegaard.net>
To: "Serge Dukhopel" <dukhopel at gmail.com>
Cc: <plt-scheme at list.cs.brown.edu>
Sent: Wednesday, October 29, 2008 11:08 AM
Subject: Re: [plt-scheme] srfi/42 filter doen't work


> Serge Dukhopel skrev:
>> Hi, I'm trying to use srfi/42 and found a problem. Following code
>> (it's actually one of the test cases from srfi/42ref/examples-42.ss)
>>
>> #lang scheme
>> (require srfi/42)
>> (list-ec (:range n 5) (if (even? n)) (:range k (+ n 1)) (list n k))
>>
> I can confirm this is a bug. The underlying cause is that the if in the 
> mzscheme language
> is different from the if in the scheme language.
>
>
> To try the example either replace #lang scheme with #lang mzscheme or
> run this snippet in the Pretty Big Language:
>
>  (require srfi/42)
>  (list-ec (:range n 5) (if (even? n)) (:range k (+ n 1)) (list n k))
>
> I'll try to figure out how to fix the problem, but I fear it is a bit 
> involved
> to change the code to allow both if-bindings.  Unless  there  someone
> knows a trick...
>
> -- 
> Jens Axel Søgaard
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 



Posted on the users mailing list.