News for hackers. Stuff that matters.
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by jlarocco on Wednesday December 07, 2016 @07:41PM (#13127543)
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?

Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by MichaelBurge on Wednesday December 07, 2016 @10:13PM (#13128147)
> 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.
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by CIAvash on Tuesday December 13, 2016 @03:52AM (#13165490)
There is a doc for entering unicode characters: 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-...

Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by cygx on Wednesday December 07, 2016 @07:46PM (#13127563)
What's the non-Unicode version of "∩"? Obviously it's "(&)"!

I find that pretty obvious, actually. After all

    A ∩ B = { x ∈ A & x ∈ B }
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by jlarocco on Thursday December 08, 2016 @01:58AM (#13128865)
That 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 }
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by cygx on Thursday December 08, 2016 @04:02AM (#13129231)
If 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).