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

From: Serge Dukhopel (dukhopel at gmail.com)
Date: Tue Oct 28 16:56:11 EDT 2008

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


Posted on the users mailing list.