On Sat, Mar 15, 2003 at 08:05:03PM -0500, Joe Gottman wrote:
: 
: ----- Original Message -----
: From: "Dave Whipp" <[EMAIL PROTECTED]>
: To: <[EMAIL PROTECTED]>
: Sent: Saturday, March 15, 2003 1:35 PM
: Subject: Re: is static?
: 
: 
: > Uri Guttman wrote:
: > > talking about nested subs brought up another related idea, static (not
: > > on the stack) lexicals inside subs.
: >
: > Doesn't C<our> give you this?
: >
: 
:    Not really.   A variable declared with <our> can be accessed from
: anywhere in the program, just by redeclaring it or calling it with the
: "package::" syntax.    A variable declared with <my> can be accessed outside
: its scope only if the user returns a reference to it.  A static variable
: should be like a <my> variable except that it is only initialized once and
: is not destroyed when it goes out of scope.

It is likely that if we have "is static", the compiler would translate

    my $pi is static = 3

to something like

    our $foo__Xdeadbeef will init {.set(3)}

I really hate the word "static" though, which is why I suggested an alternative
once of something like

    our $foo is unique;

where "is unique" (or whatever) monkeys with the name to make it unique.  Then
the program representation is closer to what's actually going on.

On the other hand, "is static" would be instantly recognizable to
C programmers.  Maybe they're due for a sop...

It's not like someone isn't going to implement "is static" the moment
our back is turned anyway...

Larry

Reply via email to