Simon Cozens <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] (Dan Sugalski) writes:
>>    if ($foo > 10) {
>>      print $foo;
>>    }
>> This is mainly because of the possibility of tied or
>> overridden namespaces, which would argue for a refetch on each use.

> No, come on, Dan. It's far worse than that.

> It'll be possible, from Perl-space to override either > or print, and it
> should well be possible for them to, for instance, tie their operands. Wee!

That's not the problem. But if the overriden C<< > >> op (or the print)
changes $foo's namespace on the fly, then a refetch would be necessary.

I'd prefer to have a hint:

  our $foo is volatile;

The normal case would be to fetch $foo exactly once - before any loop.

Honestly an overridden op could insert new rules in the code and
recompile everything. If we have to always check for such nasty things,
then we can forget all performance and optimizations.

leo

Reply via email to