Functional Programing: stop using recursion, cons. Use map & vectors

Deeyana d.awlberg at hotmail.invalid
Sun May 22 22:29:26 EDT 2011


On Sun, 22 May 2011 15:47:53 -0700, Xah Lee wrote:

> this is important but i think most lispers and functional programers
> still don't know it.
> 
> Functional Programing: stop using recursion, cons. Use map & vectors.
> 
> 〈Guy Steele on Parallel Programing〉
> http://xahlee.org/comp/Guy_Steele_parallel_computing.html
> 
> btw, lists (as cons, car, cdr) in the lisp world has always been some
> kinda cult. Like, if you are showing some code example and you happened
> to use lisp vector datatype and not cons (lists) and it doesn't really
> matter in your case, but some lisper will always rise up to bug you,
> either as innocent curious question or attacking you for not
> “understanding” lisp. (just as other idiocies happen in other lang that
> lispers see but other langs don't see)
> 
> it's interesting to me that all other high level langs: Mathematica,
> perl, python, php, javascript, all don't have linked list as lisp's
> list. It's also curious that somehow lispers never realises this. I've
> been having problems with lisp's cons ever since i'm learning Scheme
> Lisp in 1998 (but mostly the reason is language design at syntax and
> lack of abstraction level in calling “cons, car, cdr” stuff, without
> indexing mechanism). Realizing the algorithmic property and parallel-
> execution issues of linked list is only recent years.

You might be interested in Clojure, then. Lists are more abstracted, like 
in Scheme, and vectors and also dictionaries/maps and sets are first 
class citizens along side lists. And unlike Scheme, Clojure has good 
library/host interop support. You can write real-world applications in it 
without spontaneously combusting.



More information about the Python-list mailing list