[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: can s-exprs represent a graph without eval?
At Thu, 19 Jun 2003 20:19:44 -0400, "Anton van Straaten" wrote:
> 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.
In theory (although I don't know of any real languages that support
this well), you could have such expressions in strict languages, too.
For simple examples like the one above, where the contents of the list
are visible, it's easy enough to build a macro to construct the
circular list. I think that it is possible to do better, however, with
some dynamic checking.