On 14 Dec 2002, at 16:32, Randal L. Schwartz wrote:
Rafael == Rafael Garcia-Suarez [EMAIL PROTECTED] writes:
Rafael What do you expect B::Deparse::coderef2text to do here ? Output
Rafael something equivalent to { 42 + shift } ?
Yes. Because that would be a serialization of the current behavior.
This is where we disagree. This deparse [to { 42 + shift}] would, IMO,
but a uselessly broken change of the essential semantics of the
subroutine. Granted that either way is wrong, I think that {$constant +
shift} is closer to being useful [if you can't actually have it correct]
that would be { 42 + shift }.
The *essential* semantics, to my view, is that the subroutine is
referencing a variable -- the parser has virtually no way to determine
that the variable is actually a constant [barring some incredibly
complicated and subtle global flow analysis], but it for-sure knows that
the subroutine is referencing a variable [and that *NOT* a true
constant].
I think it is a different problem, which I'm also not as sure about as
you are, to determine exactly *when* the current value of a variable
ought to be included as part of the semantics of a subroutine or not.
For example, in the case of your getter/setter subroutine, we would
almost certainly agree that any deparse that *didn't* include the
existence of and references to the share vbl would be useless. But I'm
not as convinced that dumping the *current*value* is necessarily
obviously the right thing to do. What if the shared variable were a
global instead of a closed-lexical, would that change whether you dumped
the value along with the subroutine or not?
But then, that kind of discussion isn't very much fun..:o)
/B\
--
Bernie Cosell Fantasy Farm Fibers
mailto:[EMAIL PROTECTED] Pearisburg, VA
-- Too many people, too few sheep --