trustedtomato / proposal-partial-expression

Function partial application, operator partial application and all that fun stuff.
10 stars 1 forks source link

Ambiguity of the ternary operator with ?? #4

Closed trustedtomato closed 6 years ago

trustedtomato commented 6 years ago

The code #?? +1 : 2 needs a lookahead for the parsing, and that lookahead might be at any size, since the code could be #?? +11111111111111 : 2 too. Any idea for another notation? Or is there a need for them at all?

Mike Samuel mentioned the bug.

trustedtomato commented 6 years ago

There are really not obvious cases which suggest that the referring to outer layers should be eliminated:

// Example 1:
let foo = #foo(#???:??)

// Example 2:
let constant = ##??

// Example 3:
let makeAdder = ##?+??

Credit goes to Isiah Meadows. He mentioned these.

trustedtomato commented 6 years ago

Resolved in fa0f074202dd8b46f14b052ec92289dffe7cc4c3.