Re:Set in Your Ways: Perl 6’s Setty and Baggy Types
by kbp on Wednesday December 07, 2016 @09:36PM
(#13127989)
What "high weirdness"? Sets in most languages that have them do not support indexing, because they're usually understood to be unordered. Aside from that, there is a method to convert a list to a set. What are you confused about?
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types
by hsitz on Wednesday December 07, 2016 @10:07PM
(#13128126)
Yes, in mathematics sets are by definition unordered, so it would be strange to have a language that supported indexing of a set.
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types
by ab5tract on Thursday December 08, 2016 @06:15AM
(#13129645)
It's fun to answer questions that could be easily answered with a single invocation, but here goes: coercing a set ($set.Set) is a no-op.
my $set-of-sets = set $set;
The above will create a new set with $set as its only member.
The OP had some snark to offer on the subject of "Texas" operators, and the documentation lists them by their Unicode glyphs. That they work I get. But I think it's reasonable to gather a sense of second-class citizenship from their presentation.