|
|
|
|
|
by ghj
2176 days ago
|
|
OMG there are multiline lambdas!!! https://coconut.readthedocs.io/en/master/DOCS.html#statement... But trying it out, it doesn't even look like python anymore. Especially if you want to nest them a lot like in other callback heavy languages. It requires a lot of semicolons and parens to get past the parsing ambiguity problem:
https://stackoverflow.com/questions/1233448/no-multiline-lam... # Incorrect, the lambda returns (y, [1,2,3]) here!
map(def (x) ->
y=x+1;
return y
, [1,2,3])
# Right
map((def (x) ->
y=x+1;
return y
), [1,2,3])
|
|