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

*To*: "Guy Steele - Sun Microsystems Labs" <address@hidden>, <address@hidden>*Subject*: RE: can s-exprs represent a graph without eval?*From*: "Anton van Straaten" <address@hidden>*Date*: Thu, 19 Jun 2003 21:42:38 -0400*Importance*: Normal*In-reply-to*: <200306192007.h5JK7Qs03462@sydney.East.Sun.COM>*Sender*: address@hidden

Guy Steele wrote: > Sometimes an circular structure can be used to "advantage". > Consider this bit of code: > > (mapcar #'+ x '#1=(1 -1 . #1#)) [corrected] > > If x is (1 4 7 10), the result will be (2 3 8 9). > > Does this puzzle you? You get 1 point. > Does this delight you? You get 5 points. > Does this nauseate you? You get 10 points. I can see nauseating aspects, but related more to cryptic syntax than anything else. Should the following Haskell also be considered nauseating, and if so, why? x = [1, 4, 7, 10] altlist = 1 : -1 : altlist zipWith (+) x altlist => [2,3,8,9] Not sure if the infinite list can be defined inline, but if not, it's probably a good thing which reduces the nausea factor. My delight with this version is only moderated by the typing rules, which require that a different function be used with a different number of input lists (map vs. zipWith). Anton

**References**:**Re: can s-exprs represent a graph without eval?***From:*Guy Steele - Sun Microsystems Labs <Guy.Steele@sun.com>

- Prev by Date:
**RE: can s-exprs represent a graph without eval?** - Next by Date:
**Re: can s-exprs represent a graph without eval?** - Previous by thread:
**Re: can s-exprs represent a graph without eval?** - Next by thread:
**RE: can s-exprs represent a graph without eval?** - Index(es):