News for hackers. Stuff that matters.
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by zokier on Wednesday December 07, 2016 @03:31PM (#13125943)

    say 42 ∈ <42  55  1>;   # False; ∈ operator cares about object identity
As an outsider, this seems like a huge gotcha. I suppose the weirdest thing (after reading some docs) is why < > quotation is used as a set literal here. Would something like

    say 42 ∈ (42, 55, 1);
work as expected? Or what would be the canonical way of writing an Int (not IntStr) set literal?
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by sp332 on Wednesday December 07, 2016 @04:30PM (#13126394)
The angle brackets are explicitly string operators. So the set contains the string "42" but not the number 42. Perl does generally have different operators for strings vs numbers, so that's something you'd be used to thinking about already. Probably not a huge gotcha.

Edit: these things are weird though. https://docs.perl6.org/type/IntStr

Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by labster on Wednesday December 07, 2016 @03:41PM (#13126019)

    perl6 -e 'say 42 ∈ (42, 55, 1)'
    True
That works fine -- and probably better than the quote-words operator <>. ∈ works on anything list-like, not just set types.
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by ab5tract on Wednesday December 07, 2016 @05:28PM (#13126859)
To clarify, it isn't being used as a set literal. It's a list passed to an operator that happily coerces your lists to sets.

Allomorphs are tricky things, but I think it was the right decision to treat them separately in collections.

`Set.new(42, 55, 1)` is the most formal way to create a new set, but Perl 6 provides `set(42, 55, 1)` as a shorthand.