[plt-scheme] Buggy behaviour of the R6RS enumeration module?

From: Thomas Chust (chust at web.de)
Date: Sat Aug 23 07:48:23 EDT 2008

Hello,

if I understand R6RS correctly, the procedure enum-set->list should, 
just as the name indicates, always return a list when passed an enum set 
as a parameter.

But unless the set passed in is empty, the return value from that 
procedure is something else, as you can see by executing the example 
code below.

Is this a bug or am I doing something wrong?

cu,
Thomas


#lang scheme
(require
  (lib "rnrs/enums-6.ss"))

(define-enumeration foo
   (bar baz)
   foo-set)

(define l0
   (enum-set->list (foo-set)))

(printf "(list? l0) => ~s~%(pair? l0) => ~s~%l0 => ~s~%~%"
         (list? l0)
         (pair? l0)
         l0)

(define l1
   (enum-set->list (foo-set bar)))

(printf "(list? l1) => ~s~%(pair? l1) => ~s~%l1 => ~s~%~%"
         (list? l1)
         (pair? l1)
         l1)


Posted on the users mailing list.