>   Yes, it almost seems like there is no language visible difference
> between having the variable exist in the outer scope (file) and having
> it exist in the outermost scope in which it is referred to.  Please
> correct me if you are thinking of one.

No, I can't see one. Not if you're auto-scoping, that's my point.

>   It just seems safer to tie everything down to the lowest block you
> can get it into.
>
>   If I'm correct in asserting that there are no language-level
> differences, then I think we should recommend whichever is easiest to
> the implementers. 

I think that's true for the most part. I don't mind tying things down
tightly as long as they're auto-scoped liberally. But it does seem like
excess and unnecessary work if there's no language difference.

> >    3. We introduce a new keyword, say "your()", that makes
> >       variables true dynamic variables.
> 
>   :)  Yes, I know you're pretty happy about your().  All I really have
> in mind is just the same effect the vars pragma has right now. 

Actually, this might be better. If you have a 'use vars' pragma, then
this can be the only method for declaring global dynamics. Indeed, it
should be the only method you need, since global dynamics are bad in
most cases. However, having them available as global switches *is*
valuable.

I don't think suggesting that we eliminate globals altogether is a good
or feasible idea. It's an unnecessary crutch. They are useful in many
circumstances.

I think this is shaping up to be a really good proposal. Here's what I
hear:

  1. All variables are liberally lexically scoped by
     default. Either scope them package-wide or do the
     nearest block idea.

  2. You can explicitly scope variables with my or our.

  3. Global variables can still be declared with 'use vars'.

  4. Dynamic keywords (like local) still only work on
     global variables.

Sound accurate? Exactly how point #1 is implemented can be left till
later, just as long as this:

   $x = 1;
   {
      $y = $x + 1;
   }
   print "$y";

Works without any predeclarations.

-Nate

P.S. I meant "package-wide" in the previous email. The package should
always be the outermost logical container, I think.

Reply via email to