C
Christopher T King
Is it feasable, and/or desirable to have Python optimize tail-recursive
calls, similar to Scheme and gcc -O2? i.e. effectively compile this:
def foo(n):
return foo(n-1)
into this:
def foo(n):
goto foo(n-1)
This would naturally only be enabled in optimized bytecode.
On an unrelated, Scheme-ish note, is there any way for a generator to
access itself? i.e. I want to be able to write this:
def gen():
yield get_current_continuation(),someothergenerator()
Thanks,
Chris
calls, similar to Scheme and gcc -O2? i.e. effectively compile this:
def foo(n):
return foo(n-1)
into this:
def foo(n):
goto foo(n-1)
This would naturally only be enabled in optimized bytecode.
On an unrelated, Scheme-ish note, is there any way for a generator to
access itself? i.e. I want to be able to write this:
def gen():
yield get_current_continuation(),someothergenerator()
Thanks,
Chris