From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10773 invoked by alias); 29 Apr 2015 23:22:26 -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: 35001 Received: (qmail 20951 invoked from network); 29 Apr 2015 23:22:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS autolearn=ham version=3.3.2 Message-ID: <554167AA.1000209@case.edu> Date: Wed, 29 Apr 2015 19:22:18 -0400 From: Chet Ramey Reply-To: chet.ramey@case.edu Organization: ITS, Case Western Reserve University User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Stephane Chazelas , zsh-workers@zsh.org CC: chet.ramey@case.edu Subject: Re: [BUG] Can't mark unset variables as read-only References: <55407BBF.6020401@inlv.org> <20150429113602.374240c7@pwslap01u.europe.root.pri> <150429065556.ZM31553@torch.brasslantern.com> <20150429154136.152b7b05@pwslap01u.europe.root.pri> <5540F9B6.5020805@case.edu> <20150429190909.GB5530@chaz.gmail.com> In-Reply-To: <20150429190909.GB5530@chaz.gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Junkmail-Whitelist: YES (by domain whitelist at mpv2.tis.cwru.edu) On 4/29/15 3:09 PM, Stephane Chazelas wrote: > 2015-04-29 11:33:10 -0400, Chet Ramey: > [...] >> func() >> { >> local foo=bar >> echo inside: $foo >> } >> >> func >> echo outside: $foo >> >> Bash gives the following output: >> >> ./x26: line 5: local: foo: readonly variable >> inside: immutable >> outside: immutable >> >> If the purpose of readonly is to make a particular name/value pair >> immutable, I think that allowing a local variable to shadow it, >> especially if you're going to export that local variable, is a bad thing. > [...] > > I don't agree. OK, we can disagree. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/