[racket] circular lists are not lists or sequences

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Wed Dec 12 15:49:54 EST 2012

On 12/10/12 11:00 AM, Jens Axel Søgaard wrote:
> 2012/12/10 David Van Horn <dvanhorn at ccs.neu.edu>:
>> On 12/10/12 10:14 AM, Matthew Flatt wrote:
>>>
>>> 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?
>>
>>
>> Yes, an `in-pairs' seems right to me.  I can submit a pull request if that
>> design is OK.
>
> I'd like to lobby that in-pairs is the following,
> wherein the clause [p (in-pairs '(1 2 3))] lets binds p
> to the pairs of the list.

This is probably the right thing for something called `in-pairs', but 
what I really want is something like `in-not-not-list' that works for 
all things that are lists or circular lists, without the need for car in 
the body.  Is there a good name for such a thing?

David



Posted on the users mailing list.