Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Ted Leung on the air: Open Source, Java, Python, and ...
Mon, 20 Oct 2003
.Net, Functional Programming, and Python
Erik Meijer is
showing the relationship between C#/Java iterators and functional constructs such as fold and list comprehensions. He then points out that Python has already demonstrated how to incorporate fold and list comprehensions into an imperative langauge. I'm a fan of fold and list comprehensions, which is why I was happy to find them in Python. Meijer is right when he says
[22:20] |
[computers/programming/python] |
# |
TB |
F |
G |
0 Comments |
Most importantly many list transformers, including map and filter can be defined as both catamorphisms and anamorphisms, and list comprehensions are ultra sweet, but very thin syntactic sugar on top of the base language. In principle there is nothing that prevents special list transformers and comprehensions from being introduced into imperative languages as well. We know how to do it. In fact, as is the case for many other features, Python has already taken the lead in this.When one of the designers of Haskell98 writes:
Pure functional programmers, your days are numbered. The grim reaper is knocking at your door.somebody better pay attention.
You can subscribe to an RSS feed of the comments for this blog:
Add a comment here:
You can use some HTML tags in the comment text:
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
<a href>
, <em>
, <i>
, <b>
, <blockquote>
, <br/>
, <p>
, <code>
, <pre>
, <cite>
, <sub>
and <sup>
.You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk