Why I chose Common Lisp over Python, Ruby, and Clojure
postabon.posterous.com
Why I chose Common Lisp over Python, Ruby, and Clojure
1–10 of 143 posts
Re: Why I chose Common Lisp over Python, Ruby, and Clojure
#2Re: Why I chose Common Lisp over Python, Ruby, and Clojure
#3You could probably get rid of the "(fixed)" in your title; I bet most people didn't see your original submission, and the ones that did will know what happened.
Just reposted the same content on Posterous.
Re: Why I chose Common Lisp over Python, Ruby, and Clojure
#4In the case of map and filter, is there any compelling reason to use either of those instead of list comprehensions or generator expressions?
Re: Why I chose Common Lisp over Python, Ruby, and Clojure
#5Looking forward to that.
Re: Why I chose Common Lisp over Python, Ruby, and Clojure
#6The fact that he proposed removing map, reduce, filter, and lambda from Python 3. In the case of map and filter, is there any compelling reason to use either of those instead of list comprehensions or generator expressions?
But I often think 'functionally.' Since I have options, I'd rather go with a language that allows me to program how I think - instead of being forced to translate my thought into its semantics.
Re: Why I chose Common Lisp over Python, Ruby, and Clojure
#7Re: Why I chose Common Lisp over Python, Ruby, and Clojure
#8Re: Why I chose Common Lisp over Python, Ruby, and Clojure
#9The fact that he proposed removing map, reduce, filter, and lambda from Python 3. In the case of map and filter, is there any compelling reason to use either of those instead of list comprehensions or generator expressions?
I think it is a matter of language design. Higher order functions are not as prominent in Python as say, Haskell, where map & friends are generally preferred for composability. Lispers prefer map & friends just because list comprehensions add all that messy syntax.
If I were a Python programmer, I would probably use list comprehensions, since they seem to be the preferred idiom.
Re: Why I chose Common Lisp over Python, Ruby, and Clojure
#10The fact that he proposed removing map, reduce, filter, and lambda from Python 3. In the case of map and filter, is there any compelling reason to use either of those instead of list comprehensions or generator expressions?
e.g.
map(expensive_call, filter(cond, seq))
equals [expensive_call(each) for each in seq if cond(each)]
but filter(cond, map(expensive_call, seq))
equals [each for each in [expensive_call(x) for x in seq] if cond(each)]
note because of "expensive_call", it's inefficient (and silly) to do [expensive_call(each) for each in seq if cond(expensive_call(each))]
So map/filter combination gives more flexibility than list comprehension, and for functional-thinking minds, it's just so natural to think in abstract terms of passing functions around. List comprehension is pretty syntactical sugar to do similar things, but it forces you think about the "how to do" instead of "what to do".That said, it's not really "compelling" though -- there is no real "compelling" reason to switch from one Turing-complete language to another given that you can do the same thing eventually. But hey, it's the itches that drive us nuts, isn't it? :)
Just my 2 cents