[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can s-exprs represent a graph without eval?



Guy Steele - Sun Microsystems Labs <Guy.Steele@sun.com> writes:

> Sometimes an circular structure can be used to "advantage".
> Consider this bit of code:
> 
>   (mapcar #'+ x '#1=(1 -1))
    ^^^^^^^^^^^^^^^^^^^^^^^ . #1# 

In an example designed to illuminate circular lists, it's wise to make
the list circular ;-)

> 
> If x is (1 4 7 10), the result will be (2 3 8 9).

-- 
Jane - Daria? Come on, the neighbors are starting to talk.
Daria - Um... good. Soon they'll progress to cave drawings and civilization 
will be on its way.