I was aluding to this tongue-in-cheek article I had just posted. I think it's a more common symbol than, say, @list».*foo, which is actual Perl 6. At least it has precedent, rather than being something totally new.
What is a "urxvt"?
After posting, I noticed that it did not show well in the font my browser chose for it. The hook is too small and it is easily confused with a solid vertical bar.
So assuming font issues were taken care, what do you think of seeing ⌈$x⌉ to mean round up to an integer using ceiling semantics? Even the well-known trunc is not known at a glance to have floor or toward-zero semantics while the synonym ⌊⌋ would be obvious.
Even more so in domain-specific notation: why invent a legal identifier name when a symbol or notation is already in use with the intended meaning?
—John | [reply] [d/l] [select] |
urxvt is a Unicode capable rxvt (the fact it didn't display well was due to the symbol missing in the fonts that are used); rxvt is a lightweight virtual terminal; an xterm with a lot less memory.
As for ⌈$x⌉, I would understand what it means. I wouldn't use it, typing ceil I can do blind, while I would have to look up the codepoints for ⌈ and ⌉, and even then it will take more than 4 keystrokes.
As for ⌊⌋, it wouldn't be equivalent to trunc. tt>⌊⌋ rounds towards negative infinity (well, at least it does so in math - it may round towards 0 in Perl6), so it would be equivalent to floor.
As for "inventing" legal identifier names, a couple of points:
- There's no point in "inventing" names. Symbols typically have names, and all Unicode symbols have names. So if you use the name of the symbol as the identifier name, you're not inventing it. You just use the name instead of the symbol.
- ASCII will be working correctly on a lot more platforms than Unicode for a long time to go.
- Keyboard sizes are limited. Most Unicode symbols are not present on a keyboard and need special handling to input them. Letters are present and inputted much more easily.
- Only a handful symbols are well-known; and most of them are present on the keyboard and are already used by Perl.
- Most people will be able to find floor efficiently in an index, as people know f follows e and comes before g. But where does ⌉ go? It's ok if you have a handful of symbols, but not if you have hundreds.
Syntactic sugar is nice, but too much sugar spoils a dish.
| [reply] |