3 ms·
Every Perl6 article I read makes it even less likely that I'll ever use it. It's so ugly, with so many arcane things to remember, with so many weird naming con
by jlarocco 10y ago
Every Perl6 article I read makes it even less likely that I'll ever use it.
It's so ugly, with so many arcane things to remember, with so many weird naming conventions that just don't make any sense to me.
> We intersected two sets with the ∩, U+2229 INTERSECTION, intersection operator and received a set that contains only the elements present in both original sets.
I'm not against having built-in Unicode operators, but the non-Unicode version should be the name of the character. What's the non-Unicode version of "∩"? Obviously it's "(&)"! Good thing there are only 57 of them to remember!
I tried to enter "∩" just now in Emacs: (ctrl-x, 8, enter, i, n, t, tab, r, tab, s, e, c, tab). It would have been shorter to just type "intersection"... And why is that called the "Texas" version?
- cygx 10y agoWhat's the non-Unicode version of "∩"? Obviously it's "(&)"! I find that pretty obvious, actually. After all A ∩ B = { x ∈ A & x ∈ B }
- jlarocco 10y agoThat at least explains where it comes from, but I'd still argue it won't be obvious to people at first. And it's still kind of confusing. If the goal is to match math notation then wouldn't (^) or (+) make more sense? A ∩ B = { x ∈ A ∧ x ∈ B }
- cygx 10y agoIf the goal is to match math notation then wouldn't (^) or (+) make more sense? Not necessarily. & is the ASCII symbol associated with logical 'and' that most programming languages have settled on, including Perl6, so for internal consistency, it makes sense to use it. Also note that the ampersand, while pretty rare, is sometimes used for that purpose in mahematical notation (https://en.wikipedia.org/wiki/List_of_logic_symbols https://en.wikipedia.org/wiki/List_of_logic_symbols).
- MichaelBurge 10y ago> What's the non-Unicode version of "∩"? Obviously it's "(&)"! That convention has decades of precedence in programming: int bitset_a = 0x01234567, bitset_b = 0x89ABCDEF; int bitset_c = bitset_a & bitset_b; And at least a century in math.
- CIAvash 10y agoThere is a doc for entering unicode characters: https://docs.perl6.org/language/unicode_entry.html https://docs.perl6.org/language/unicode_entry.html It also has an Emacs section. For a more detailed explanation for Emacs see my blog post: https://blog.ciavash.name/2016/01/09/entering-perl6-unicode-characters-in-emacs.html https://blog.ciavash.name/2016/01/09/entering-perl6-unicode-...