Why is Python popular, while Lisp and Scheme aren't?

Courageous jkraska at san.rr.com
Wed Nov 27 19:58:31 EST 2002


>It's a new keyword.  So, e.g., if you have a variable named "yield", you'll
>have to rename it, or forget moving to 2.3; that's the only kind of breakage
>introduced via yield.  The way people whine about stuff like this, you'd
>think it was real work <wink>.

:)

I still disagree with the decision to not have a defgenerator clause
(or equivalent) however. BDFL pronuncements in the PEP notwithstanding.

For one thing, had yield not been meant to imply generator in the
context of the function in which it is used, yield could have been
executed in the body of a function which perculated that being
yielded to the first appropriate defgenerator in the invocation
stack, somewhat like a limited kind of continuation. To wit:

defgenerator g ():

	f()

def f():

	while 1:

		yield None

x = g()

while x.next():

	something()

Ddon't know about actual _implementation_ mind you, but it struck
me that it would be quite useful if "yield" actually raised something
that was next()able. x = g() would therefore be syntactic sugar for
"except Continuable, c:"

C//




More information about the Python-list mailing list