From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12816 invoked by alias); 26 Nov 2015 09:44:31 -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: 37219 Received: (qmail 23102 invoked from network); 26 Nov 2015 09:44:28 -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-AuditID: cbfec7f5-f79b16d000005389-94-5656d21eeed0 Date: Thu, 26 Nov 2015 09:34:21 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: POSIX_BUILTINS and readonly parameters, again Message-id: <20151126093421.3703a454@pwslap01u.europe.root.pri> In-reply-to: <151125163351.ZM5279@torch.brasslantern.com> References: <151125163351.ZM5279@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xa7pyl8LCDP5/0bA42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGROmtbIVbOCs6Fol08C4lb2LkZNDQsBE4uS5Z8wQtpjEhXvr 2boYuTiEBJYySlw+cYoVJCEkMINJYmlXIkTiHKNEy45WZgjnLKPEwXf72ECqWARUJS7+/ghm swkYSkzdNJsRxBYREJc4u/Y8C4gtLGAlcXvffbB1vAL2Ehvm9IPVcApYSvz+M4cNYpuFRPvt NrA4v4C+xNW/n5ggzrOXmHnlDCNEr6DEj8n3wGYyC2hJbN7WxAphy0tsXvOWGWKOusSNu7vZ JzAKz0LSMgtJyywkLQsYmVcxiqaWJhcUJ6XnGukVJ+YWl+al6yXn525ihATz1x2MS49ZHWIU 4GBU4uEtsA0LE2JNLCuuzD3EKMHBrCTC++ocUIg3JbGyKrUoP76oNCe1+BCjNAeLkjjvzF3v Q4QE0hNLUrNTUwtSi2CyTBycUg2M0YdPLNNwc9dyfqUcknR24zJ90c3SeTk3vjBwnNC+EyIa 9tj//3MGBu19O83WeaW9sX8Z5H+h1ZN33aRaponZhoZBWYce8fpn3lq8tfHhn7rnk5YsaCgz XCvpz3r6O+uRJfe2rj7KZi72cPk8ORnH/Z2XlF6Gxp7Umt/0Psrz82Vm9nWL72VNVmIpzkg0 1GIuKk4EABAqSjNiAgAA On Wed, 25 Nov 2015 16:33:51 -0800 Bart Schaefer wrote: > Conversely if POSIXBUILTINS is set, readonly variables are unset unless > assigned in the declaration Right, that was the point. > [good thing we fixed array assignment there]: Actually, that reminds me... % readonly -a foo=(one two) % readonly -p typeset -a foo foo=( one two ) typeset -ar foo We don't need to make such heavy weather of this now. But that can wait. > So the only reason for testing isset(POSIXBUILTINS) in createparam() is > the case where POSIXBUILTINS *changes* between time of declaration and > time of assignment: I'm sure your analysis is correct, however the rule we were trying to implement starts "if POSIXBUILTINS is set ..." (and then goes on about readonly and unset variables). It seems peverse to have to analyse the whole sequence and decide that part of the change is actually benign in other cases when that's not really relevant to what's being implemented. However, removing the test with a suitable comment about the effect of the code, now you've worked it out, would certainly be a valid alternative approach. pws