Thunk expressions and thunk arguments

Guido van Rossum wrote:
This seems really elegant. I hope it can be worked out. One thing I find mildly disconcerting is the restriction that nothing can follow the thunk. If you can do this: a = thunkuser: thunk It seems like you should be able to do this (however unwieldy it looks): a,b = (thunkuser: thunk ), thunkuser: thunk And once you allow one-line thunks, following them in an expression won't seem quite as unwieldy: a,b = (thunkuser: thunk), (thunkuser: thunk) My discomfort is an artifact of allowing thunks to be used in expressions. The restriction seems perfectly reasonable in these contexts: thunkuser: thunk thunkuser(a): thunk
Doesn't lambda already accomplish this? Everything between "lambda" and ":" is interpreted as an argument list. In the same light, def stores the function name, interprets the argument list, and sets the function body to the thunk code. Perhaps the following could be equivalent: def func(args): body def(func) lambda args: body -Jerry
participants (1)
-
Gerald S. Williams