grol-io / grol

Go REPL Open Language
https://grol.io
Apache License 2.0
22 stars 2 forks source link

lambda parsing bug #208

Closed ldemailly closed 2 months ago

ldemailly commented 2 months ago
f=x=>(y => x + y)
// evaluates to
x=>y=>{x+y}
// doesn't reparse
15:33:49.421 r1 [ERR] Error loading autoload line "f=x=>y=>{x+y}": parsing error: [1: lambda parameters must be identifiers, not =>
f=x=>y=>{x+y}
        ^ 1: expected next token to be `:`, got `}` instead:
f=x=>y=>{x+y}
            ^]

in general x=>y=>z=>(x+y+z) should work