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

Re: Proof of concept: "static" parameter scope

# okiddle@xxxxxxxxxxx / 2015-09-28 19:04:59 +0200:
> Bart wrote:
> > "Called functions" includes recursive calls to the function itself, so
> > this doesn't work like C "static".  Therefore I'm in the market for a
> > better name.
> The trouble with "static" is that people with a C or C++ background will
> expect something different. It might be better to find a new word in the
> thesaurus that doesn't carry the baggage of another common meaning. Note
> that, as you mention in the documentation patch, ksh93 has a typeset
> -S option which does do C like static variables. Aside from confusing
> users, the Zsh use of the term "parameter" seems even more tenuous when
> applied to lexically scoped variables because they can't be used as
> named parameters. So instead of "static" I would simply suggest "var".

agree wholeheartedly with everything Oliver said.

one nitpick: "var" has no semantics regarding scope, which is not a
problem per se, but with 'local' doing something (naively) unexpected,
maybe a stronger signal would be in order?

i'd maybe suggest "private" instead, but the sweet succintness of "var"
is really attractive.  hmm, what about "my"?

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