[racket] Bug in srfi-42

From: William James (w_a_x_man at yahoo.com)
Date: Fri Jan 9 18:53:18 EST 2015

Racket bug:

Welcome to Racket v6.1.1.
> (require srfi/42)
> (list-ec (: n 2 8) (if (odd? n)) n)
'(3 5 7)
> (first-ec #f (: n 2 8) (if (odd? n)) n)
stdin::80: :until: expected <generator> in
  in: (if (odd? n))
  context...:
   C:\Program Files\Racket\share\pkgs\srfi-lib\srfi\42\expansion.scm:68:2: gener
ator->loop
   C:\Program Files\Racket\share\pkgs\srfi-lib\srfi\42\expansion.scm:127:7
   C:\Program Files\Racket\collects\racket\private\misc.rkt:87:7

The output should be
3

Gauche Scheme handles this correctly:

gosh> (use srfi-42)
#<undef>
gosh> (first-ec #f (: n 2 8) (if (odd? n)) n)
3




Posted on the users mailing list.