On Wed, 21 Jan 2009 09:42:19 -0000, Lars Behrens <spam.bus...@web.de>
wrote:
Rhodri James wrote:
I *was* thinking of code produced in the real world, and I don't buy
your assertion. I'm not an academic, and I wouldn't hesitate to lay
down a line of code like that. As I said before, it fits into English
language idioms naturally, and as a result is pretty self-descriptive.
As a non-native speaker and non-academic, I don't understand the "fittine
into English language idioms naturally" which is mentioned here in the
different subthreads. Could you try to explain that for me?
It just means that the progamming language concept in question has the
same "shape" (i.e. roughly the same syntax) as an English language
syntactic construct in common use. So for list comprehensions we have
[ f(x) for x in l ]
and
"Make a list of f(x) for each x in the list l."
You can see how the elements of the list comprehension fit sequentially
into the English sentence. As other people have pointed out, this
particular example really comes from the mathematical notation for
constructing sets:
f(x) ∀ x ∊ l
...but it's no accident that they both "translate" straightforwardly
into English!
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list