XP is just a number | |
PerlMonks |
RE: RE: RE: Re: Dreaming of Post Interpolationby swiftone (Curate) |
on May 30, 2000 at 21:57 UTC ( [id://15461]=note: print w/replies, xml ) | Need Help?? |
Hmm. Seems to me that this could be done with a fancy Tie somehow. Not quite as you have posted it though....Perhaps if $m, $o, and $s were also cascaded... How far would you want this to go? While the above example could be done, I can see it getting messy with subroutine calls. For example: Will that output 3 6 ?. Stream of conciousness: the Monitor package uses a tie on a variable to track when a variable is changed...can we track when it is accessed, and turn on cascading for any lvalue, etc? (I see dire consequences on the stack/heap, but...) Then when any such value is modified, you could go through the cascade stack and reset every value. It would go nuts on code like: Because $m is altered by $n, and thus when we change $n, we recalc $m, which is in turn set by $n, so we recalc.... But I guess this isn't much different from screwing your reference count by doing a $a=\$a (except of course that that doesn't hang). All speculation anyway, since I don't believe that there is any way to find what lvalue is affected by a variable reference.
In Section
Seekers of Perl Wisdom
|
|