Recursively traverse linked list -- help!
Paul Rubin
phr-n2002a at nightsong.com
Wed Feb 20 18:37:18 EST 2002
More information about the Python-list mailing list
Wed Feb 20 18:37:18 EST 2002
- Previous message (by thread): Recursively traverse linked list -- help!
- Next message (by thread): Recursively traverse linked list -- help!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Jason Orendorff" <jason at jorendorff.com> writes: > > > def f(val): > > > global f > > > f = val and f1 or f2 > > > return f(val) > > > > This is not tail recursion. The "global f" declaration shadows > > the "f" that names the function. > > That's not true. The f that names the function is global anyway. > It's the assignment that causes the problem. Oh yes, you're correct. However, the tail call should still be optimized, compiled as an indirect jump to f.
- Previous message (by thread): Recursively traverse linked list -- help!
- Next message (by thread): Recursively traverse linked list -- help!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list