News for hackers. Stuff that matters.
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by ab5tract on Wednesday December 07, 2016 @04:03PM (#13126196)
What are your expectations for reliable generalization? What were you expecting to work, in what way, that didn't work as you expected?
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by throwanem on Wednesday December 07, 2016 @04:34PM (#13126437)
The Rakudo REPL apparently doesn't save history outside a session by default, so I don't have the exact details of what I was trying to do. In attempting to recreate it, though, I did manage to discover that Perl 6 "sets" appear simply to be syntactic sugar around strings split on whitespace, except when they're not, sometimes. That's not necessarily a bad thing, but why call it a type? What is it actually giving me that I can't get without having to bind and learn to use a whole new keymap full of exciting Unicode characters that I'm not a mathematician and therefore will also need to learn to identify on sight?
Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by ab5tract on Wednesday December 07, 2016 @05:23PM (#13126820)
I've never used a Unicode operators myself and there are no requirements to use Unicode characters. Every Unicode operator has a "Texas" counterpart in 100% ASCII. This was mentioned in the OP.

I think you are mistaking `<a b c d>` with a `Set`. `< >` is a shorthand for "give me a `List` of these words" (or in this case, characters). `<a b c d>.Set` would coerce you a `Set` from that list. The set operators coerce by default, so you can pass it a list of words without requiring you to coerce it yourself beforehand.

Re:Set in Your Ways: Perl 6’s Setty and Baggy Types by throwanem on Wednesday December 07, 2016 @06:41PM (#13127250)
Yeah, I cottoned to that eventually - it's short(er)-hand for Perl 5's qw() construct. I guess Set is a method (coercer!) of...lists? List-shaped things? Sets seem list-shaped, although indexing doesn't work by any syntax I could find, and certainly not by any that an @ sigil should suggest. Can I call Set on a set? Does it do something weird if I do? And if I'm going to deal with this kind of high weirdness, why not just bite the bullet and go with Haskell or even Urbit? This just feels like it's trying to out-Ruby Ruby, and Ruby is Ruby enough already.

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.

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.