2 ms·
xs = 1:xs Lazy evaluation makes it possible to construct circular data structures without mutation.
by foldr 10y ago
xs = 1:xs
Lazy evaluation makes it possible to construct circular data structures without mutation.
- kbp 10y agoOr in Lisp one could write #1=(1 . #1#), eg: CL-USER> (subseq '#1=(1 2 3 . #1#) 0 10) (1 2 3 1 2 3 1 2 3 1)
- foldr 10y agoAh that's interesting. I was going to say that in principle a strict language could have a special syntax for defining circular data structures, but I didn't know about that particular corner of CL.