Re: Set difference using hashes vs array

2017-11-23 Thread ToddAndMargo
On 11/23/2017 06:09 PM, Brandon Allbery wrote: On Thu, Nov 23, 2017 at 9:06 PM, ToddAndMargo > wrote: On 11/22/2017 08:41 PM, Norman Gaywood wrote: my Set $take1 = (%all (-) %remove) (-) %excludes; What does "Set" do in the above? Declares a typ

Re: Set difference using hashes vs array

2017-11-23 Thread Brandon Allbery
On Thu, Nov 23, 2017 at 9:06 PM, ToddAndMargo wrote: > On 11/22/2017 08:41 PM, Norman Gaywood wrote: > >> my Set $take1 = (%all (-) %remove) (-) %excludes; >> > > What does "Set" do in the above? > Declares a type, which helps avoid errors. Similarly `my Int $a` means $a can only take Int values

Re: Set difference using hashes vs array

2017-11-23 Thread ToddAndMargo
On 11/22/2017 08:41 PM, Norman Gaywood wrote: my Set $take1 = (%all (-) %remove) (-) %excludes; What does "Set" do in the above?

Re: Set difference using hashes vs array

2017-11-23 Thread Elizabeth Mattijsen
Fixed with https://github.com/rakudo/rakudo/commit/eacf9b2776 . Thanks for reporting! > On 23 Nov 2017, at 05:27, Norman Gaywood wrote: > > Talking to myself :-) > > Seems it has something to do with the values in the hash. If they are just > True, this works: > $ perl6 > To exit type 'exi

Re: Set difference using hashes vs array

2017-11-23 Thread Elizabeth Mattijsen
Will have a look at this in about 12 hours (probably). Meanwhile, don’t let that stop anyone from figuring this out :-) > On 23 Nov 2017, at 05:27, Norman Gaywood wrote: > > Talking to myself :-) > > Seems it has something to do with the values in the hash. If they are just > True, this w

Re: Set difference using hashes vs array

2017-11-22 Thread Norman Gaywood
Talking to myself :-) Seems it has something to do with the values in the hash. If they are just True, this works: $ perl6 To exit type 'exit' or '^D' > my %a= :k, :e, :r; my %r= :r; my %e= :e; my Set $s = %a (-) %r (-) %e; set(k) On 23 November 2017 at 16:20, Norman Gaywood wrote: > For comp

Re: Set difference using hashes vs array

2017-11-22 Thread Norman Gaywood
For compactness, here are the 1-liners: $ perl6 To exit type 'exit' or '^D' > my %a= k=>"k", e=>"e", r=>"r"; my %r= r=>"r"; my %e= e=>"e"; my Set $s = %a (-) %r (-) %e; Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏k' (indicated by ⏏) in block at line

Set difference using hashes vs array

2017-11-22 Thread Norman Gaywood
I'm not sure what this error message means and what is going on here: perl6 --version This is Rakudo version 2017.08 built on MoarVM version 2017.08.1 implementing Perl 6.c. $ cat tt-h.p6 #!/usr/bin/env perl6 my %excludes = "exclude" => "exclude"; my %all = :keep("keep"), :exclude("exclude"), :re