by jlarocco · 9y ago · 0 comments
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?
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.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-...
I find that pretty obvious, actually. After all
A ∩ B = { x ∈ A & x ∈ B }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 }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).