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

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

Shriram Krishnamurthi wrote:
> and you want their background colors to alternate: white, grey, white,
> grey, ....  Set COLORS to
>   '#0=("white" "grey" #0#)
> Now you can peel off the CAR and CDR of COLORS for as many names as
> there are on your list.

First Guy, now you - clear evidence that these list shenanigans are too much
for the human brain!  ;)  If that's Scheme, I think you mean:

	'#0=("white" "grey" . #0#)

Ever since I first saw it, I've liked the way lazy languages allow you to
achieve the same end, e.g. in Haskell:

	colors = "white" : "grey" : colors

It's a very direct expression of the desired result.