On Sat, May 14, 2005 at 10:56:29PM +1000, Damian Conway wrote:
> 3. To drill down a hierarchical data structure, following the path
> specified by a list of keys:
>
> $leaf_value = [.{}] %hash, @keys;
I think this one needs to be written as:
$leaf_value = [.{}] \%hash, @keys;
But, assuming the given syntax does the right thing, the description
reads as though this generates something akin to:
$leaf = %hash.{$k1}.{$k2}.{$k3}...{$kN}
Does this really work?
if $sum = [+] 1,2,3,4
is the same as $sum = 1 + 2 + 3 + 4
Then surely $leaf = [.{}] %hash, $k1, $k2, $k3
is the same as $leaf = %hash .{} $k1 .{} $k2 .{} $k3
And %hash .{} $key doesn't make sense to me. What am I missing? It seems
to me that would have to be written as
$leaf_value = [$^a.{$^b}] %hash, @keys;
in order to work properly (still assuming the %hash doesn't need the \
that I think it does)
> Personally I think a metaoperator with that many uses is more than
> Swiss-Army enough to be in the core of Perl 6.
Indeed! :-)
-Scott
--
Jonathan Scott Duff
[EMAIL PROTECTED]