Re:Why I chose Common Lisp over Python, Ruby, and Clojure
by maxtilford on Wednesday December 02, 2009 @05:38PM
(#973176)
Using do-notation is probably cheating, but what do you think of this? (in Haskell):
We're trading horizontal space for vertical space. I think it's much clearer than either list comprehensions or plain map/filters. It's the best of both worlds.
[ Parent
| on HN ]
Re:Why I chose Common Lisp over Python, Ruby, and Clojure
by frig on Wednesday December 02, 2009 @06:15PM
(#973255)
I like the look of it. Am I correct that the order the statements are in translates into the order things are evaluated in when the code is called?
If eg I edited it to be:
do { l <- locations;
w <- widgets;
guard (l `hasInStock` w);
s <- sprockets;
guard (l `hasInStock` s);
guard (w `isUsableWith` s);
return (w,s,l); }
Does that force it to go through "location-first" and only check the w and s of (w,s,l) for compatibility if it has already ascertained that w and s are in stock @ l?
Re:Why I chose Common Lisp over Python, Ruby, and Clojure
by maxtilford on Wednesday December 02, 2009 @07:12PM
(#973344)
Yes, that's correct.