Re:Ask HN: My nephew wants to learn programming. What should...
by jrockway on Monday January 25, 2010 @11:24PM
(#1077018)
Lisp:
(loop for i from 1 to 10 collect i)
Ruby:
[1..10].collect { |x| x }
But anyway, it turns out that people are not born with an inherent ability to parse infix operators. Infix is just as arbitrary as prefix or postfix. Anyone, even a kid, will figure the syntax out either way.
(Infix leads to confusing bugs, like "why doesn't 'foo < bar < baz' work?" Prefix eliminates this ambiguity.)
(Infix leads to confusing bugs, like "why doesn't 'foo < bar < baz' work?" Prefix eliminates this ambiguity.)