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

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

It's a problem with module-or-top-identifier=? or with the use of it, I think.
The keyword if is not recognized if it comes from scheme/base.
The example does work with #lang mzscheme.
It also works with:
#lang scheme
(require (only-in mzscheme if))

With pretty-big:

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

Jos



----- Original Message ----- 
From: "Serge Dukhopel" <dukhopel at gmail.com>
To: <plt-scheme at list.cs.brown.edu>
Sent: Tuesday, October 28, 2008 9:56 PM
Subject: [plt-scheme] srfi/42 filter doen't work


> 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))
> 
> produces an error message: "list-ec: <generator> or <filter> expected,
> got: in: (if (even? n))"
> The same example but with "or" (as well as "and" and "not") instead of
> "if" works perfectly:
> 
> (list-ec (:range n 5) (or (even? n)) (:range k (+ n 1)) (list n k))
> => ((0 0) (2 0) (2 1) (2 2) (4 0) (4 1) (4 2) (4 3) (4 4))
> 
> It's not blocking me (I can use either "or" or "and" with the same
> result), but I believe that it's a bug.
> 
> Problem is present at least in versions 4.1, 4.1.1 and today's 4.1.2
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20081029/2f5f0a17/attachment.html>

Posted on the users mailing list.