From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14255 invoked by alias); 19 Jan 2017 09:48:19 -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: 40385 Received: (qmail 14586 invoked from network); 19 Jan 2017 09:48:19 -0000 X-Qmail-Scanner-Diagnostics: from mail.cs.uni-magdeburg.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(141.44.21.48):SA:0(-3.2/5.0):. Processed in 2.462254 secs); 19 Jan 2017 09:48:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: elkner@cs.uni-magdeburg.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at cs.uni-magdeburg.de does not designate permitted sender hosts) Date: Thu, 19 Jan 2017 10:43:07 +0100 From: Jens Elkner To: zsh-workers@zsh.org Subject: Re: LOCAL_VARS option ? Message-ID: <20170119094307.GA20123@trex.cs.ovgu.de> Mail-Followup-To: zsh-workers@zsh.org References: <20170119065408.GA5534@fujitsu.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170119065408.GA5534@fujitsu.shahaf.local2> User-Agent: Mutt/1.5.21 (2010-09-15) X-Milter: milter4j - Mail Filter for Java 1.1.4 (b767) X-Milter: ClamAV 0.98.1-jel on mail - Status: Clean X-RcptTo: zsh-workers@zsh.org On Thu, Jan 19, 2017 at 06:54:08AM +0000, Daniel Shahaf wrote: > Phil suggested on IRC a LOCAL_VARS option that has the effect of making > all newly-declared variables local; e.g., Hmmm, I like the implicit way ksh93 does it, i.e. if declared within a "function $fname {...}" declared function using 'typeset', it has local scope, otherwise (i.e. not typeset or typeset in "$fname() { ... }" aka old style declared functions) shared. Not sure, whether this can be accomplished with zsh as well ... have fun, jel. -- Otto-von-Guericke University http://www.cs.uni-magdeburg.de/ Department of Computer Science Geb. 29 R 027, Universitaetsplatz 2 39106 Magdeburg, Germany Tel: +49 391 67 52768