3 ms·
That was a pretty late change to the syntax actually — I really, really wanted Javascript-style lambdas but with a skinny arrow, like `(x, y) -> x + y`. But it
by news_to_me 3y ago
That was a pretty late change to the syntax actually — I really, really wanted Javascript-style lambdas but with a skinny arrow, like `(x, y) -> x + y`. But it made parsing and compiling really finicky, so I settled on the backslash syntax, which I've seen in a couple other languages. It almost looks like a "λ"!
- somewhereoutth 3y agoAlternatively, we can go the other way, and dispense with the arrow: \x \y x + y rather closer to the lambda notation in maths, and works well for compact expressions such as S from the SKI combinator calculus: \x \y \z x z (y z) This looks much better with syntax highlighting (hard to demonstrate here of course), being both trivial to implement and informative - just have the back slashed tokens in blue or whatever. Cassette looks really nice - great intro page, and a great name too! Making something simple is much harder and more valuable than making something complicated.