From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3248 invoked by alias); 28 Sep 2015 18:04:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36678 Received: (qmail 21901 invoked from network); 28 Sep 2015 18:04:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Date: Mon, 28 Sep 2015 19:58:34 +0200 From: Roman Neuhauser To: Oliver Kiddle Cc: zsh-workers@zsh.org Subject: Re: Proof of concept: "static" parameter scope Message-ID: <20150928175834.GE3670@isis.sigpipe.cz> References: <150924192305.ZM2680@torch.brasslantern.com> <21593.1443459899@thecus.kiddle.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21593.1443459899@thecus.kiddle.eu> User-Agent: Mutt/1.5.23 (2014-03-12) # okiddle@yahoo.co.uk / 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"? -- roman