qwertie / ecsharp

Home of LoycCore, the LES language of Loyc trees, the Enhanced C# parser, the LeMP macro preprocessor, and the LLLPG parser generator.
http://ecsharp.net
Other
172 stars 25 forks source link

LES3: Operators by themselves #109

Open qwertie opened 4 years ago

qwertie commented 4 years ago

Sometimes you just want to write

Foo(list, ...)

without getting an error, and it would be nice if it were possible to use operators as if they were names, much as in Haskell:

reduce(+, 0, [11,22,33]) // 66

In Haskell the operator must generally be in parentheses (+), and of course this would sometimes be required in LES too (+(2,3) means something quite different than (+)(2,3), and I propose that ==(2,3) would remain illegal).