On 2019-11-22 Marc Chantreux <e...@phear.org> wrote:
> ";" to walk in the hoh is really awesome but i don't know even know
> from where i know it and what's the object underneath.
> it isn't listed in the list of operators

It's mentioned in the page about subscripts:
https://docs.perl6.org/language/subscripts#Multiple_dimensions (it's
not easy to find, though, unless you know already that it's there)

The method seems to be::

  multi sub postcircumfix:<[; ]>(\SELF, @indices)

and its adverbial variants.

This works::

  my %section = ( a => %( b => %( c => 1 ) ) );

  my @path = «a b c»;

  say postcircumfix:<{; }>(%section,@path);

and prints ``(1)`` (the return value is a list)

From a quick look through ``Perl6/Grammar.nqp`` and
``Perl6/Actions.nqp``, I think that the semicolon is special-cased by
the compiler, so the slightly ugly way above (call the operator
directly) is probably the only way that works.

-- 
        Dakkar - <Mobilis in mobile>
        GPG public key fingerprint = A071 E618 DD2C 5901 9574
                                     6FE2 40EA 9883 7519 3F88
                            key id = 0x75193F88

Reply via email to