[racket] circular lists are not lists or sequences

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Dec 10 10:14:36 EST 2012

We did change `in-list' to add a `list?' guard, so the behavior is as
intended. Maybe we need a new `in-' sequence constructor that works as
long as pairs appear for as far as you demand sequence elements?

At Mon, 03 Dec 2012 18:12:51 -0500, David Van Horn wrote:
> I have some code that's been broken somewhere between 5.1.1 and git 
> HEAD.  The issue seems to be either that circular lists no longer are 
> considered lists by `list?', or `in-list' has added a `list?' check (and 
> circular lists were never `list?').
> 
> In any case, these are the kinds of things I would expect to work, but 
> don't.  Is this a bug?
> 
>  > (for/first ([y (shared ((x (cons 1 x))) x)]) y)
> for: expected a sequence for y, got something else: #0='(1 . #0#)
>    context...:
>  
> /Users/dvanhorn/Documents/git/racket/collects/racket/private/for.rkt:451:2: 
> make-sequence
>  
> /Users/dvanhorn/Documents/git/racket/collects/racket/private/misc.rkt:87:7
> 
>  > (for/first ([y (in-list (shared ((x (cons 1 x))) x))]) y)
> in-list: contract violation
>    expected: list?
>    given: #0='(1 . #0#)
>    context...:
>  
> /Users/dvanhorn/Documents/git/racket/collects/racket/private/for.rkt:551:2: 
> in-list
>  
> /Users/dvanhorn/Documents/git/racket/collects/racket/private/misc.rkt:87:7
> 
> Thanks,
> David
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.