Steve D'Aprano wrote:
Do you consider:
for foo in bar:
if baz(foo):
f(foo) # append to a list, or print, or yield, as needed
declarative?
No. But the reason for that is not because it has the word
"for" in it. The reason is that it's made up of statements.
Statements are procedural, expressions are declarative.
SQL's SELECT ... WHERE is one of the canonical examples of declarative
programming:
Despite the fact that "select" is a verb in English. :-)
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list