Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
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 <p.w.stephenson@ntlworld.com>
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
X-Seq: zsh-workers 37499

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

