On Tue, Aug 09, 2005 at 12:33:48PM -0700, Larry Wall wrote:
> : Alternatively, this could raise a warning and treat the second my()
> : as a no-op.  Personally, I'm in favour of an exception.
> 
> I think the exception should certainly be the default, perhaps with
> the other behavior pragmatically available.

Yay for sanity!

> : The only problem I see with it is that $CALLER::x from &ADD's position
> : will refer to the inner, not the outer, $x.
> 
> A similar problem pops up for "eval" as well, though arguably it is the
> same problem if the compiler is using the CALLER mechanism to lookup
> variables.

Right, they are the same problem, as "eval" merely compiled string into a
Code and calls it in-place.

> : However, seeing that the two
> : arguments are in different scopes, I think it is not worth keeping any 
> promise
> : about interaction between $CALLER:: and mid-block declarations anyway.  
> : 
> : Does this sound sane?
> 
> We can certainly declare it to be sane.  :-)

Please do then. :)

> Alternately, we could do the fancy thing now and just remember the actual
> limits of the variables' visibility.  But only if it's fun.  :-)

The fancy thing (position-counting) is likely to get out of control
rapidly under macros, so it's probably not much fun.  Erroneousness
sounds much saner.

Thanks,
/Autrijus/

Attachment: pgpg7x2jW7vAL.pgp
Description: PGP signature

Reply via email to