On Sun, Oct 24, 2021 at 11:45 PM Ricky Teachey
It seems to me that the syntax for late binding could be chosen so as to leave the possibility of expansion open in the future, and defer (har har) the entire generalized thunk discussion?
So why not go with syntax like this, where before the ? just represents a keyword to be bike shedded ("defer", "thunk", "later", "...."):
def func(a, b=? a): ...
I kind of like using the ellipses btw; it looks sort of like "later..." to me:
def func(a, b = ... a): ...
I'm not a fan of a keyword to cause late evaluation, for several reasons: * If it's a hard keyword, then it can't be used anywhere, despite having meaning only in one specific place. * If it's a soft keyword, there is confusion based on what's otherwise a perfectly legal identifier name. * It's extremely long. At very best, it'll be five letters, and maybe longer, just to change when something is evaluated. That could easily be longer than the expression that it's governing. Keywords are awesome for some situations, but not for this one IMO. Using ellipsis is kinda cute, but I don't think it'll really help here, especially as it's a perfectly valid token at that point. Consider: def func(a, b=...+a): ... Is this going to attempt to add Ellipsis and whatever is in the global a, or is it going to do a unary plus on the first argument? If thunks are introduced, they would be actual values, which should mean they can simply use the normal argument defaulting mechanism. There should be no conflict. ChrisA