3 ms·
An alternative solution: if you're willing to allow non-ASCII characters into your source code, then DrRacket provides a keyboard shortcut to insert a λ charact
by waterhouse 15y ago
An alternative solution: if you're willing to allow non-ASCII characters into your source code, then DrRacket provides a keyboard shortcut to insert a λ character. I'll illustrate with anonymous recursion.
> (define sum
(λ (n)
((λ (f) (f f n 0))
(λ (f n total)
(if (zero? n)
total
(f f (- n 1) (+ n total)))))))
> (sum 10)
55
- Jach 15y agoYou can go one step further and start giving things like color meaning. (example: http://www.colorforth.com/ide.html http://www.colorforth.com/ide.html written with colorForth http://www.colorforth.com/cf.htm http://www.colorforth.com/cf.htm ) Of course, alternatives should exist for someone to write on a US-keyboard in any editor. Clojure supports two ways to do anonymous closures, though neither of them use a lambda symbol.
- sneak 15y ago> if you're willing to allow non-ASCII characters into your source code Blasphemy.
- Raphael 15y agoYou could use any letter, really. Perhaps l or f.