Em Seg, 2009-01-05 às 07:57 -0800, Dave Whipp escreveu:
> my $ace = 1 | 11;
> my $seven = 7;
> my @hand = $ace xx 3, $seven;
> my $junc_value = [+] @hand; ## any( 10, 20, 30, 40 )
> There are a bunch of possible values in the junction. The one we care
> about is the largest that is not greater than 21. Using Perl6 as it
> stands today, the way to extract this value is brute force:
> my $concrete_value = max (0..21).grep: { $^score == $junc_value };
Well, that considering we don't have any introspection into junctions,
but I think it should be quite straight-forward to make junctions behave
as a list of its members...
my $ace = 1 | 11;
my $seven = 7;
my @hand = $ace xx 3, $seven;
my $junc_value = [+] @hand;
my $concrete_value = max $junc_value.grep: { $^scope < 21 };
daniel