Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Proof of concept: "static" parameter scope

On Sep 29, 10:34pm, Daniel Shahaf wrote:
} Bart Schaefer wrote on Mon, Sep 28, 2015 at 18:23:27 -0700:
} > Make up a completely new term?  "limited" ?  "bounded" ?  "scoped" ?
} disinherit?

Sounds like something you do after the fact, like "export".  Which I
suppose is a way it could have been implemented -- first declare the
local and then impose scoping.  That's approximately what happens
behind the scenes here anyway.  Hmm.  "isolate"?

On Sep 29,  7:31pm, Andrew Janke wrote:
} I'm a fan of "my". Perl's "my" and "local" are exactly the example I use 
} when explaining the behavior of zsh "local" variables to new users. This 
} new scope seems to correspond pretty well to Perl's "my" lexical scoping.

I like the concept of "my" but have never been thrilled with the name.

} Or maybe "auto"? The C "auto" storage class (the default one, scoped to 
} a block in a function activation) corresponds pretty well to this

Yes but again "auto" refers (as you note) to storage ... all zsh locals
are "auto" in that sense.  This needs to describe visibility.

Really, "local -S" (or some other letter if we're trying to save -S for
something) is the ideal thing.  The only reason we even need another
name is to set up the handler function.

Since PWS has voted in favor of "private" I think I'm going to revise
the patch in favor of that.  There's also no "-P" option of typeset in
either bash or ksh, so although I don't like the (dis)similarity with
"-p" I think we can go with "local -P" for "private".

Messages sorted by: Reverse Date, Date, Thread, Author