> > Elements of this shared vocabulary might be
> > called 'locals' or 'yours'.
>
> I like the 'yours' idea from the point of
> view of the callee:
> 
>         my $inherited = your $_;

I like that syntax, but I'm uncomfortable
with an underlying principle, which is that
one can reach in to the caller's lexical
context from any place in a callee's body.
It exacerbates the (mostly over-stated, imo)
action-at-a-distance concerns about this.

I know you can do what you wrote anyway with
the $CALLER::foo syntax, but I don't like that
either.

Allison et al have already intimated that they
too find a generic 'yours' (or $CALLER::foo)
capability that can be fired off anywhere in
a sub's body to be dangerously obscure, to say
the least. So while they expect to provide the
raw $CALLER::foo capability, they have suggested
some sugar that's a lot prettier AND a lot less
dangerous for common cases (probably just for
dealing with $_, though I am currently thinking
it could work rather nicely to have it work for
any lexical).

Hence my focus on putting any callee side 'yours'
sugar in the sub preamble.


> However, I also like the idea of having to
> mark shareable lexicals explicitly in the
> caller, and the "your" keyword doesn't work
> as well from the caller's point of view:
> 
>         your $_;
>         somesub();      # this sub can see $_ 
> 
> It almost calls for "our"; too bad that's
> taken.

I was thinking of yours as in "yours too",
and as in a property:

    my $foo is yours;

$_ would be yours(rw) by default, all other
lexicals are not yours by default. The ability
to have yours(ro) and yours(rw) is part of why
I was thinking in terms of a property rather
than a, er, whatever C<my> is.

--
ralph

Reply via email to