Iterating through two lists
Kragen Sitaker
kragen at pobox.com
Sat Jun 1 02:49:16 EDT 2002
"Donn Cave" <donn at drizzle.com> writes:
> Paul Prescod was right (as paraphrased on the followup page linked
> in the page above) - he really did choose an example that favored
> Lisp.
Sort of.
> The function that carries data is cool enough. Lisp does it easier
> than Python, and in fact does "functional programming" better than
> Python by a long shot.
That's debatable.
> But then, Python does OOP better than Lisp!
Your certainty suggests deep ignorance. How familiar are you with
CLOS?
> He seems vaguely mystified that Python programmers would favor the
> much more tedious class solution, but of course if you wanted to add
> some requirement like support two functions over that data instead
> of just one, then the mystery evaporates.
Like
(defun addergetter (x) (list (lambda (i) (incf x i)) (lambda () x)))
?
> When you take on a comparison between two decent languages, though,
> you have a lot of impossible questions about which big picture concepts
> are really going to pay off. Does OOP live up to its promise on
> re-use of code, can ordinary people really "get" functional programming
> and become really productive in it, does one approach or another really
> reduce complexity in a meaningful way. Jury's still out.
I think it's pretty clear that object orientation and functional
programming both reduce complexity in a meaningful way.
More information about the Python-list
mailing list