in reply to Re: On Declaration
in thread On Declaration
Ok, you have a point here, but I dont think its relevent. The fact that that package and variable namespaces autovivify themselves into existance is orthagonal to the fact that package or our were used. Nothing intrinsic about them "created" anything, instead a rule that is in effect in many situations besides when you use these keywords is responsibile for the autovivification. For instance any fully qualified variable name usage or subroutine declaration would have done the same thing.
A second issue is that your second example is a poor one. You arent testing for the existance of $Bar there, you are testing for the existance of any variable type with the given name. If I defined a subroutine Bar the first test would have shown positive. As a matter of fact afaik there isnt any way to tell if a given package scalar has been used for sure. You can tell it hasn't been used some of the time, and you can tell it has been used some of the time, but you cant tell both all of the time.
I think to me it comes down to this. Using other approaches I can write a program that is identical from an introspective view to any program written with package and our declarations. However the same is not true with my, or sub (afaik).
While the scoping rules for our and package are different from my they still "declare" something so it makes sense to me :-)
I would prefer that there was a better term for what my and sub do, and that "declare" meant the same thing in computereses as it does in english, but alas such is not so. And accordingly I think its dangerous to mix the terms.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: On Declaration
by adrianh (Chancellor) on Jun 15, 2003 at 23:19 UTC | |
by demerphq (Chancellor) on Jul 06, 2003 at 14:23 UTC |