Yitzchak Gale writes:
Python's "iterators" are not the same as iterators in C
and other older languages. They are lazy lists. The reason
they named them "iterators" is not to scare people.
Haskell was not the first to have lazy lists, but Haskell
was an important part of the inspiration for introducing
them into Python.

Actually, I would *sincerely* like to see some reference proving that.
I cite Guido V.R., 2005:
"About 12 years ago, Python aquired lambda, reduce(), filter() and
 map(), courtesy of (I believe) a Lisp hacker who missed them and
 submitted working patches."
(http://www.artima.com/weblogs/viewpost.jsp?thread=98196)
Give to Caesar...: It was Amrit Prem; one history page on WP says that
no specific mention of any Lisp heritage is mentioned in the release
notes at the time, so all speculations are still possible... ++
But, in fact, Python iterators - in general - are neither lazy nor lists.
No linking!
They are syntactic shortcuts to *objects* possessing the method 'next'.
So, there is no call by need, no updated thunks, etc. Calling them lazy
is an abuse of the language, although quite intuitive. I don't want to raise
a war about that...
The laziness, meant as deferred procedure calls *CAN* be used in Python,
also in iterator context, through generators, that's true. But still there
are no update'able automatically thunks, no lazy data! If generators remind
me of something, it is co-routines.
BTW. The BDFL Van Rossum never said anything about "scaring". He said
plainly that folds are things he *hates* most.

Guido was forced to do something - someone had written
a new Python interpreter, called "Stackless Python",
in which every Python function was a Scheme-like continuation.
People found this very, very scary. So Guido stopped
it by introducing laziness, which could be made much
less scary.

Give to Caesar...
Someone, was Christian Tismer: http://www.python.org/workshops/2000-01/proceedings/papers/tismers/spcpaper. htm and I am doubtful about the statement that people found it very, very scary. Simply they - usually - felt no *need* for another complication to learn,
you know, *some* people are lazy... But Stackless still exists, GVR
stopped nothing, and the Grant Olson's tutorial http://members.verizon.net/olsongt/stackless/why_stackless.html is really interesting, although perhaps, as usual, not for Andrew Coppin.
People, stop using this damned word: "scare" in the context of *learning*
something! Jerzy Karczmarczuk

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to