Re: LIST-LENGTH & circular lists
shivers@xxxxxx 23 Apr 2001 16:56 UTC
> So, there are basically these two levels: pure lists and
> side-effectable lists. In the pure-list world, it is not
> interesting or even well-defined to ask the
> how-many-elements-in-this-circular-list question. In the
> side-effectable list world, it makes sense.
In your "pure" world, there's no such thing as a circular list -
there's no distinction basically, btw a circular list & a stream, and
list-length should then return infinity.
But this is scheme, which isn't "pure". It's not clear to me why the
distinction between a pure list & a "side-effectable" list should be
made.
People frequently like to work in a "pure" subset of Scheme. Simpler world,
more axioms about your code & data hold. Sometimes, you work in this world
in one chunk of your program, then take an impure view for some other piece
where it's necessary to do so.
-Olin