From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22406 invoked by alias); 29 Apr 2015 14:52:05 -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: 34998 Received: (qmail 11289 invoked from network); 29 Apr 2015 14:52:02 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f5-f794b6d000001495-24-5540edba7f54 Date: Wed, 29 Apr 2015 15:41:36 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [BUG] Can't mark unset variables as read-only Message-id: <20150429154136.152b7b05@pwslap01u.europe.root.pri> In-reply-to: <150429065556.ZM31553@torch.brasslantern.com> References: <55407BBF.6020401@inlv.org> <20150429113602.374240c7@pwslap01u.europe.root.pri> <150429065556.ZM31553@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+NgFjrMLMWRmVeSWpSXmKPExsVy+t/xy7q73jqEGjzYbmVxsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4Mjb/3cdcMJm94v3Nj8wNjNdZuxg5OSQETCS+H+tnhrDFJC7c W88GYgsJLGWUuNXk2cXIBWTPYJK4uHMnK4SzjVFi4o277F2MHBwsAqoS+24IgDSwCRhKTN00 mxHEFhEQlzi79jwLiC0sYCVx79EBdhCbV8BeYtOl32A2J1C8e+86RoiZvYwSK2bPYgJJ8Avo S1z9+4kJ4iJ7iZlXzjBCNAtK/Jh8D2wos4CWxOZtTawQtrzE5jVvmSGuVpe4cXc3+wRGoVlI WmYhaZmFpGUBI/MqRtHU0uSC4qT0XCO94sTc4tK8dL3k/NxNjJCg/bqDcekxq0OMAhyMSjy8 EiYOoUKsiWXFlbmHGCU4mJVEeHNuA4V4UxIrq1KL8uOLSnNSiw8xSnOwKInzztz1PkRIID2x JDU7NbUgtQgmy8TBKdXAyPBT42/hLznrJldLfZY1+0QSX5fkTI7+flvycOi0txePbD5e0CPf 2TDrrVOczcIOixwPMdva1N6nUcd/xGkw7HVyTTV+npq9Z/0h0YRX2bGzF8cwzSu/zr7r2d6Z dpeTo+efnn+uedI5r6XGzY+ss//5M3zaKfPaZW9+Pvf5+y9a3+/eKLeqRomlOCPRUIu5qDgR AIYMHj9WAgAA On Wed, 29 Apr 2015 06:55:56 -0700 Bart Schaefer wrote: > On Apr 29, 11:36am, Peter Stephenson wrote: > } > } +Note that in zsh (unlike other shells) it is still possible > } +to create a local variable of the same name as this is considered a > } +different variable (though this variable, too, can be marked readonly). > > Hrm, I wonder if that, combined with "typeset" automatically creating > locals when called in a function context (also a POSIX incompatibility?) > defeats the whole purpose of an unset readonly? I don't think so... bash makes these local, too: $ foo=bar $ fn() { typeset foo=something_else; echo $foo; } $ fn something_else $ echo $foo bar So "foo" in fn is logically something entirely different and I don't think there's any requirement for it to be treated as readonly; it's entirely a matter for the definition of "fn". pws