From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26781 invoked by alias); 3 Jan 2016 19:00:39 -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: 37499 Received: (qmail 2413 invoked from network); 3 Jan 2016 19:00:37 -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 X-Originating-IP: [82.20.18.64] X-Spam: 0 X-Authority: v=2.1 cv=Sd8KDalu c=1 sm=1 tr=0 a=tQ56d2wE10i0ATcm3CvKvA==:117 a=tQ56d2wE10i0ATcm3CvKvA==:17 a=NLZqzBF-AAAA:8 a=kj9zAlcOel0A:10 a=Z6bBq_QLxZZ-L61t4CsA:9 a=CjuIK1q_8ugA:10 Date: Sun, 3 Jan 2016 19:00:31 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [BUG] functions can't create global readonly variables Message-ID: <20160103190031.24249cf5@ntlworld.com> In-Reply-To: <160102123639.ZM16270@torch.brasslantern.com> References: <56874393.1010001@inlv.org> <160101202710.ZM1896@torch.brasslantern.com> <20160102181814.3ac8d578@ntlworld.com> <160102123639.ZM16270@torch.brasslantern.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit By the way it seems that, in bash at least, "readonly" breaks encapsulation: $ readonly foo=empty $ fn() { local foo=bar; echo $foo; } $ fn bash: local: foo: readonly variable empty The only use I can see of this is for exported variables, where you might want to ensure a specific value was always exported to an external programme. pws