Larry Wall wrote:
On Sat, May 14, 2005 at 06:41:35PM +0200, Juerd wrote:
: Larry Wall skribis 2005-05-14 9:20 (-0700):
: > Possibly. Or we just define infix .{}. and .[]. variants, or some such.
: : The problem is that we already have @foo[] meaning the same as @foo, and
: an always allowed . that also allows you to put whitespace around it.
: This means that %foo.{}.$kv should really just be %foo.kv, if $kv eq
: 'kv'. I think this won't work well with two dots surrounding {}.
: %foo.{}$kv OTOH is currently invalid syntax, so available for
: assimilation. Ugly, yes, but I would never suggest actually using this
: operator literally -- it's fine to just have it for reduce.
Good thing I said "or some such". :-)
: OTOH, reduce probably just needs to be smart enough to understand : postcircumfix. Perhaps whitespace helps, [{ }], in parallel with : &postcircumfix:<{ }>, to avoid a conflict with an infix {}.
Erm, I don't like tokens with spaces in the middle.
Actually, I think Damian's original formulation is sufficiently clear.
I read it all, and thought that it should be written:
$leaf = %hash{[;] @keys};
Which is taken from what Larry was talking about when he first brought up the [] metaop.
Unless, of course, there is some subtle difference between a 3-d hash and a hash of hashes of hashes that invalidates this.
-- Rod Adams