Warning: I just watched The Wizard Of Oz
for the first time tonight.

> $x is yours
>
> tells that $x is aliased to variable in
> some "secret scope symbol table" that
>( the table ) is shared between caller
> and callee

The "secret" place is MyYourca, a Subterranean
island. People think it's an old, dangerous and
complex place, but actually it's a new, simple,
friendly, safe yet dynamic principality that
juxtaposes two localities each of which is just
an ordinary lexicality, as a defense against the
evils of globalization.

I'm not sure about the symbolism of all this;
I'll let others hash that out.


> also, another way :
>
> $x is yours
>
> is like saying that all functions that
> will ever call each other ... then I
> will croup them in a group ... may be
> thought of as being in special common
> *enclosing* lexical scope

Perhaps. I find what you've said confusing
so I'm not sure what you mean.

MyYourca already exists for transfer of
variables to called subs via parens; the
scheme I'm talking about just uses the
same MyYourca.


> *share* the same variable.

In the sense that $foo in:

    sub baz ($foo) { print $foo };

    sub bar { my $foo; baz ($foo); };

is shared (between baz and bar), then yes.
Anything more complicated than that, then,
technically, no.


> {
>   my $x is yours = 1;
>   a ;
>   print $x # print 1 or 5 ?
> }
>
> sub a { $x is yours ; $x = 5 ; }

In my scheme, that would print 1 and some
variable $x that was declared either 
package-wise or lexically at the point
where sub a was defined has been changed
to 5.

If sub a were defined this way:

  sub a (;$x is yours) { $x = 5 ; }

then it would print 5.


> is "is yours" variable assigned or aliased
> in the callee scope ? probably we should
> have both , and then "is yours" mechanism
> is more general .

Well I was thinking it's always aliased but
can be read-only by attaching C<yours(ro)>
to a variable declaration (as part of an
explicit my, not in a sig; you can't put
C<is yours(ro)> in a sig -- I can't see an
alias/copy distinction, nor ability to set
ro in a sig, being worth the complexity
they introduce).


> also , anothre question . if "is shared"
> isn't thread safe , is static scoping using
>
> our $x is private ;
>
> thread safe ??

I may have incorrectly used the term "thread
safe". The point is that you can't arrange
for there being a unique $x for multiple
threads of the same code. At least I don't
see how.


--
ralph

Reply via email to