Samuele Pedroni wrote: > My point is that a suite-based syntax > can only be a half substitute for lambda and anyway requiring a suite > seems overkill and unnatural for the just 1 expression case, for example > predicates. IOW a suite-based syntax is not a lambda killer in itself, I > would not try to stress that point. I see your point (also I see Greg Ewing's related point). > multiple dispatch has nothing to do with syntax, in fact usual call > syntax is sufficient, and people do use multiple dispatch sometimes, > and decorators now can be even used to sugar up the definition side > of it. But one needs to use decorators or some other mechanism for the sugar, that is all I intended the phrase "does not give syntactic support" to mean. Perhaps "syntactic sugar" is the correct term to have used. >> for something that would be rarely used, I do not think > > well that's up to discussion to discover ok > well, but this is stated without even trying to come up with a syntax > for that case. Notice that the first time around Guido himself would > have preferred if achievable a multithunk syntax, he obviously can have > changed his mind. But, yes, syntax vs expressivity is the key issue here. Ok. Allow me to try. Up to a choice of (or existence of!) keywords, the simplest to me is: def add(thunk1, thunk2, other): print thunk1(1,2) + thunk2(3,4) + other with x,y from add(100): value x*y also a,b: # yikes?? value a*b # this is thunk2 -Brian
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4