On Python's lambda and FP in general

Top Page

Reply to this message
Author: Andy Sy
Date:  
To: True Computer Science Mailing List
CC: python
Subject: On Python's lambda and FP in general
A couple of years back, I didn't really care if Py3K
retained the lambda keyword or not and implicitly trusted
Guido's judgement on the matter (he was thinking of dropping
it).

Reading those old articles, I now find myself rooting for
lambda (it will be kept, but reduce() will be dropped -
moved to functools that is)... and I am now really starting
to appreciate the stuff I find in the functools module.

I remember a time when I saw the use of map(), reduce(),
etc... in code we were working with and thought it was
frivolous, distracting and made the code hard to read.
Now I find myself imagining situations where they'd
actually make code better/shorter.

Interestingly, it was my exposure to *Javascript* [1] that
changed my P.O.V regarding these FP-style constructs,
and not Scheme nor Lisp! (That or maybe a slowly
maturing - read: growing more mathematical - view of
things...)

http://xahlee.org/perl-python/python_3000.html
http://xahlee.org/UnixResource_dir/writ/language_to_hate.html

(What Xah Lee mentions above - the boast that "one line of
Mathematica equals ten to one thousand lines of lisp" also
makes me want to revisit Mathematica... although I always
felt Matlab was less abstruse... any comments on this?)


In fact, after realizing the pulse of Guido's thoughts on
the matter (not every FP-welcoming), I may very likely
revisit Ruby where the FP paradigm is far more welcome
(that and the fact that Matz has mentioned something
about dropping Perl-isms from Ruby)

Question to Rubyists: How does Ruby fare when it comes
to stuff like map, reduce, partial functions, etc.. ?
Is it a very Lisp-ish, few-small-ideas-can-do-everything
environment?




[1] I would recommend my "Nifty Javascript" tutorial for
a nice intro to the FP-ish side of Javascrpt:

http://www.webmechs.com/javascript-tutorials/nifty-javascript.php





____________________________________________________
Philippine Pythonista Hangout
python@??? (#Python @ irc.free.net.ph)
http://lists.free.net.ph/mailman/listinfo/python
Searchable Archives: http://archives.free.net.ph