4 ms·
Factor allows almost any special character in word (function) names. It is incredibly useful when you get the hang of it. I would love to have it in other langu
by bjourne 6y ago
Factor allows almost any special character in word (function) names. It is incredibly useful when you get the hang of it. I would love to have it in other languages.
E.g. is_prime(1234) => prime?(1234), append_inplace(l, e) => append!(l, e), array_equal(a, b) => array=(a, b), midi_to_mp3(a) => midi>mp3(a), reciprocal(a) => ^-1(a)
Lisp can do some of it but not "()" or (I think) "`';"
- kazinator 6y agoIn Common Lisp you can use pretty much any character in a symbol name, if you escape it: [3]> '|(``"| |(``"| [4]> (defvar |(``"| 42) |(``"| [5]> |(``"| 42 It's pretty dubious for code; it's useful when working with some data format that has identifiers with its own validity rules. There is more than one way to escape: vertical bars or backslashes: [6]> (eq '|(``"| '\(\`\`\") T