Jonathan Worthington wrote:
Richard Hainsworth wrote:
<snip>
Eg.
$ perl6
> my @s=1|11,2,3,4,5,6;my @x; loop {...@x=@s.pick(3);([+]
@x).eigenstates.min.say}
8
6
Method 'eigenstates' not found for invocant of class 'Integer'
>
You can detect junctions by smart-matching against the Junction type
(e.g. $sum ~~ Junction).
my @s=1|11,2,3,4,5,6;
loop {
my $sum = [+] @s.pick(3);
say $sum ~~ Junction ?? $sum.eigenstates.min !! $sum;
}
Jonathan
Except it doesnt work :(
$ perl6
> my %h=<a b c> Z 1|11,2,3;%h.perl.say
{"a" => any(1, 11), "b" => 2, "c" => 3}
> my %h=<a b c> Z 1|11,2,3;my $s = [+] values %h;$s.perl.say
any(6, 16)
> my %h=<a b c> Z 1|11,2,3;my $s = [+] values %h;say $s~~Junction ??
$s.eigenstates.min !! $s
Null PMC access in get_integer()