This is not the post I'm going to write, but it is the one I'm writing.
I recently saw a tweet that reads something like, "Nice presentation on Clojure, but any language where you write 1 + 2 as (+ 1 2) is not for me." Fair enough. I won't hold it against you if you share that sentiment.
What about a language where you write 1 + 2 + 3 + ... + 1000 as:
Lisp may seem foreign at first. And looking at a small expression in your language compared to the same in lisp may turn you off lisp forever. Fair enough.
(apply + (take 1000 (iterate inc 1)))
Maybe your language has something equally as expressive. Fair enough.
But lisp is more than prefixes and parentheses, and you may want to dig deeper into the benefits of all of lisp's characteristics. Fair enough if you don't.
5 comments:
How about:
(1 to: 1000) reduce + 0
Do you mean like this:
for (int i = 0, int j = 0; i < 1000; i++, j += i);
?
Hello Pat,
I recall writing a LISP program at OSU all on paper. No cards, no teletype nothing... just on paper. Now that is real LISP programming! :)
Hope you are doing well!
Doug Goodin
Marcel: yep.
D: nope, it's about combinators not syntax.
Doug: hi! yeah, matching parens is easier when you can use a pencil!
Using 'range' in Clojure also makes this code look a little less intimidating (take, iterate, inc, etc kinda distract the situation)
Post a Comment