### Re: Are set operations needed?

On 18/07/13 17:58, Patrick R. Michaud wrote: [...] Sets do not implement well on a computer. Let me strongly disagree with this statement. Sets implement *very well* on computer, it just suffices to know how to do it. You want a constructive proof? Check the CDuce language (http://www.cduce.org) where types are sets of values, you have all the set-theoretic operations listed in a previous mail, pattern matching is based on type-case (that is dynamic testing the type of the matched value), you have dynamic overloading as you do in Perl6. As added bonus, the language is statically type-safe and you can also have polymorphic functions (not implemented yet, but should be available in an year or so). ... and efficiency is not an issue. My two cents' worth Beppe

### Re: Are set operations needed?

On 07/18/2013 01:07 PM, Richard Hainsworth wrote: Are set operations needed in Perl6? No implementation of the perl6 set specification yet exists (AFAIK). You are wrong. Both rakudo and niecza implement significant subsets of the set specification. Cheers, Moritz

### Re: Are set operations needed?

And regardless of homotopy type theory being able to supplant set theory, with the spirit of there's more than one way to do it, set ops are still a welcome tool. Also in that spirit, would you like to write up a summary of HoTT alternatives to common set ops, or post a link to a HoTT summarzing its relation to algorithmically manipulating data? I downloaded the free PDF of that book but I'm afraid most of it will go over my head. I can grok the figures in http://en.wikipedia.org/wiki/Homotopy but not much more -y On Thu, Jul 18, 2013 at 7:16 AM, Moritz Lenz mor...@faui2k3.org wrote: On 07/18/2013 01:07 PM, Richard Hainsworth wrote: Are set operations needed in Perl6? No implementation of the perl6 set specification yet exists (AFAIK). You are wrong. Both rakudo and niecza implement significant subsets of the set specification. Cheers, Moritz

### Re: Are set operations needed?

All set operations work on Rakudo, but none of the Unicode set operators are enabled, because multibyte Unicode characters kill the performance of Rakudo's parser when compiling Rakudo. So for example you can use (|) for set union, but not ∪. I think there are probably some glitches there yet, particularly with set construction -- Rakudo's version is based on an older version of Niecza's implementation. I'll probably get around to porting Niecza's updates over to Rakudo before the August release. On Thu, Jul 18, 2013 at 11:21 AM, Richard Hainsworth rich...@rusrating.ru wrote: I'm well behind the curve on implementation, this I know. But before writing the email, I checked the perl6 web site on what was implemented. Set operations still given as not implemented. The impression I formed was that set operations would be a long time coming - even after Christmas. What subset is implemented (perhaps better, where is this documented). Richard On 07/18/2013 07:16 PM, Moritz Lenz wrote: On 07/18/2013 01:07 PM, Richard Hainsworth wrote: Are set operations needed in Perl6? No implementation of the perl6 set specification yet exists (AFAIK). You are wrong. Both rakudo and niecza implement significant subsets of the set specification. Cheers, Moritz -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

### Re: Are set operations needed?

Full list of Texas (ie ASCII) set operators: union: (|) intersection: () set difference: (-) symmetric difference: (^) subset: (=) proper subset: () superset: (=) proper superset: () is an element of: (elem) is contained by: (cont) On Thu, Jul 18, 2013 at 11:45 AM, Solomon Foster colo...@gmail.com wrote: All set operations work on Rakudo, but none of the Unicode set operators are enabled, because multibyte Unicode characters kill the performance of Rakudo's parser when compiling Rakudo. So for example you can use (|) for set union, but not ∪. I think there are probably some glitches there yet, particularly with set construction -- Rakudo's version is based on an older version of Niecza's implementation. I'll probably get around to porting Niecza's updates over to Rakudo before the August release. On Thu, Jul 18, 2013 at 11:21 AM, Richard Hainsworth rich...@rusrating.ru wrote: I'm well behind the curve on implementation, this I know. But before writing the email, I checked the perl6 web site on what was implemented. Set operations still given as not implemented. The impression I formed was that set operations would be a long time coming - even after Christmas. What subset is implemented (perhaps better, where is this documented). Richard On 07/18/2013 07:16 PM, Moritz Lenz wrote: On 07/18/2013 01:07 PM, Richard Hainsworth wrote: Are set operations needed in Perl6? No implementation of the perl6 set specification yet exists (AFAIK). You are wrong. Both rakudo and niecza implement significant subsets of the set specification. Cheers, Moritz -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

### Re: Are set operations needed?

On Thu, Jul 18, 2013 at 07:07:20PM +0800, Richard Hainsworth wrote: I wondered whether the desire to have sets in perl6 was driven by mathematical fashion sensitivity (in some roundabout unconscious way) and because sets are important to mathematical foundations. [...] Sets do not implement well on a computer. I suspect that these two statements, taken together, give a large part of the reason Perl 6 has sets implemented in the core. They're an important part of the mathematics that program(mer)s use to solve problems, and without a common foundation it's easy to come up with many suboptimal implementations. A similar argument exists for Temporal and date/time objects. Also, in earlier days of Perl 6 discussions, we discovered that people would learn about junctions and then try to use them to solve set-based problems. This frequently led to many dead-end discussions about trying to generalize junctions to that purpose. Having sets and set operators explicitly included in the core is intended to also guide people away from the false path of thinking that junctions are the Perl 6 vehicle for set-based operators. Pm