Or maybe C<where> is just the way we spell the adverb specifier?

And therefore, in turn, perhaps C<where> is how we set properties on a subroutine call:


foo('bar') where error('fatal');

Then, within the subroutine call, one can access them via C<&_.props>:

    sub foo($arg) {
        return 1 if $arg eq 'bar'
        given &_.props{error} {
            when 'fatal'   { die "horribly" }
            when 'verbose' { warn "direly"; continue; }
            default        { return 0 }
        }
    }

This would argue that such adverbs ought usually be specified like properties:

    return @foo where from(Block);
    want Lazy where context(Method);
    caller where context({.label eq 'MAINLOOP"});

which seems to read better anyway.

Damian



Reply via email to