So the actual rule is that a block standing to the right of something either creates a new function call, or gets added to the existing one. The same applies to argument lists.
This means that you can do: x(1,2) {a} (3) {b}, and what happens is very regular - a function call: x(1,2,{a},3,{b}).
I know of currying, but its not used for simple calls. A solution that shares some concepts with currying was used for handling if..else, try..catch..finally and other multi-part statements.
3 comments
[ 4.5 ms ] story [ 16.3 ms ] thread1. <call(arg1,arg2,...)> {block} => <call(arg1,arg2,...,{block})> 2. anything {block} => anything({block})
So the actual rule is that a block standing to the right of something either creates a new function call, or gets added to the existing one. The same applies to argument lists.
This means that you can do: x(1,2) {a} (3) {b}, and what happens is very regular - a function call: x(1,2,{a},3,{b}).
I know of currying, but its not used for simple calls. A solution that shares some concepts with currying was used for handling if..else, try..catch..finally and other multi-part statements.
I use [ ] as "invisible" separators, to make clear what is evaluated first, and #%If as a core version of If, perhaps programmed in another language.
In the expression
First, the If part is curryied And then we have Applying rule #2 That is equivalent to I'm not sure if this approach work and handle all the corner cases.