3 ms·
Rule #1 can be included in #2 with currying. I use [ ] as "invisible" separators, to make clear what is evaluated first, and #%If as a core version of If, perh
by gus_massa 13y ago
Rule #1 can be included in #2 with currying.
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
If (x<3) {console.newline;}
First, the If part is curryied
[If (x<3)] => [function(x) {#%If (x<3, x)}]
And then we have
[function(x) {#%If (x<3, x)}] {console.newline;}
Applying rule #2
[function(x) {#%If (x<3, x)}] ({console.newline;})
That is equivalent to
#%If (x<3, {console.newline;})
I'm not sure if this approach work and handle all the corner cases.