8 ms·
I'm still wondering why they use non ASCII characters for operators.
by stesch 9y ago
I'm still wondering why they use non ASCII characters for operators.
- yesbut 9y agoPerl 6 has ASCII versions of every unicode operator: https://docs.perl6.org/language/unicode_ascii https://docs.perl6.org/language/unicode_ascii
- collyw 9y agoIs there a key for it on my keyboard though?
- perlgeek 9y agoHey, we have docs for that :-) https://docs.perl6.org/language/unicode#Entering_Unicode_Codepoints_and_Codepoint_Sequences https://docs.perl6.org/language/unicode#Entering_Unicode_Cod...
- yesbut 9y agoyes, all of the ASCII characters are standard on most keyboards.
- sedachv 9y agoHere is a nickel kid, get yourself a real text editor: https://www.gnu.org/software/emacs/manual/html_node/emacs/International.html https://www.gnu.org/software/emacs/manual/html_node/emacs/In... Do you realize people that speak more than two languages already use multiple keyboard layouts all of the time?
- yorwba 9y agoWhy not? It's a neat way of showing off fundamental Unicode support, and AFAIK there are ASCII equivalents for all of them, in case you have no idea how to enter ⤐ or whatever.
- cesarb 9y ago> in case you have no idea how to enter ⤐ or whatever. Did you mean to type a black square there, or is my Android phone missing a font? In any case, this shows a potential issue with using Unicode characters for operators or identifiers: unless it's from a common Unicode block (like basic Greek letters), it might not be readable. It's not just writing that can be a problem.
- pletnes 9y agoI heard many times that perl is «write only». Unicode operators takes it to the next level.
- throwaway7645 9y agoAPL has used a huge set of non ASCII characters for more than 30 years in production by large companies.
- deleted 9y ago[deleted]
- jnordwick 9y agoModern APL derivatives (namely J and K) have ditched them though in favor of pure ascii.
- sedachv 9y agoThe character set and font constraints of the early 1990s, when J (1990) and K (1993) were developed, no longer apply. APL symbols are part of Unicode. There is no technical advantage left to ASCII-only syntax for APL-derived languages.
- jnordwick 9y ago> There is no technical advantage left to ASCII-only syntax for APL-derived languages. Except for that minor technical advantage of actually being on a standard keyboard. That said, I would love standard keyboards to get more symbols. I actally like using symbols instead of words for operators, when done in a consistent and logical fashion as J and K do and unlike Perl's disaster of a syntax. Map and reduce (each and over in APL lingo, in K ' and /) should be a symbol.
- raldi 9y agoOnce you decide your language is going to allow a programmer to have a variable called `meðaltal` instead of `average`, it's not much extra work to let them use an operator called `Σ`.