http://qs321.pair.com?node_id=617884


in reply to Re: [Perl 6] Any provision for a "dereferencing object"?
in thread [Perl 6] Any provision for a "dereferencing object"?

If you reverse their order, it's simply a closure:

$dereferencer = { $^moose.<foo>[1]<bar><baz>[3] }; $dereferencer($datastructure);

Yep this is very akin to what Joost suggested for Perl 5 (and was also mentioned in the original thread), except that it's more 6ish. I was thinking... is in general the semantics of $datastructure.$dereferencer definite? Is it valid syntax anyway? If not, could a C<.> infix multi, or even a macro, be specified to "amount to" the function call specified above?