3 ms·
As one dedicated Lisper to another, I think you're missing the point here. S-expressions are inherently nested, and the chaining style is about avoiding that (w
by gruseom 18y ago
As one dedicated Lisper to another, I think you're missing the point here. S-expressions are inherently nested, and the chaining style is about avoiding that (while still being side-effect free). I wrote about this a long time ago on HN... let me see if I can dig up the link.
Edit: here's one, though I remember writing something else with examples. Oh well. http://news.ycombinator.com/item?id=304871 http://news.ycombinator.com/item?id=304871
- mahmud 18y agoGood point. One way to do it might be to reify the object instance pointer to a first-class argument (usually the first.) Another way is with a dynamic variable self (might be preferable, since you don't have to break function signatures.) Yet another option might be with a custom method combination, which is overkill :-P Any other ideas? or am I too off the ball park?
- gruseom 18y agoWell, the conclusion I came to was that trying to make Lisp less nested would be like trying to make the North Pole less arctic. If you don't like programming that way, you probably aren't using Lisp in the first place. There are a few exceptions, of course (I like loop quite a bit).