From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43651-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id a21dbf3b for ; Tue, 9 Oct 2018 08:00:42 +0000 (UTC) Received: (qmail 27400 invoked by alias); 9 Oct 2018 08:00:29 -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: List-Unsubscribe: X-Seq: 43651 Received: (qmail 5108 invoked by uid 1010); 9 Oct 2018 08:00:29 -0000 X-Qmail-Scanner-Diagnostics: from www138.your-server.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(88.198.28.7):SA:0(-2.6/5.0):. Processed in 5.362386 secs); 09 Oct 2018 08:00:29 -0000 X-Envelope-From: debts@xk2c.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Subject: Re: zsh-workers 43616, typeset doesn't report tied parameters To: Zsh workers , Stephane Chazelas References: <20181009073138.c6uxzj6uljevwqcx@chaz.gmail.com> From: TS Message-ID: <816f3f14-f4d9-13f5-5e46-61da75e2eb6a@xk2c.de> Date: Tue, 9 Oct 2018 10:00:14 +0200 MIME-Version: 1.0 In-Reply-To: <20181009073138.c6uxzj6uljevwqcx@chaz.gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Authenticated-Sender: yup4hing8ed1teph9@Xk2c.de X-Virus-Scanned: Clear (ClamAV 0.100.1/25020/Tue Oct 9 06:52:43 2018) Stephane Chazelas schrieb/wrote: > 2018-10-09 00:54:16 +0200, TS: > [...] >> IMHO when a readonly is tied, the newly tied var (either scalar or array what >> ever comes last) should take over the content AND the readonly flag in one go. >> OR a readonly should not be tieable at all. > [...] > readonly is kind of a programming aid (reminder that the > parameter should be constant). Tied parameters are really > designed for the LD_LIBRARY_PATH, INFOPATH... They are > different concepts that would generally not be used together I > would say. apart from malicious code writers. e.g.: % prv() { print -l "${(t)${(P)1}} ${1}=${(P)1}" ; } % IMPORTANTVAR=foo % prv IMPORTANTVAR scalar IMPORTANTVAR=foo % readonly IMPORTANTVAR % prv IMPORTANTVAR scalar-readonly IMPORTANTVAR=foo % IMPORTANTVAR=buuz zsh: read-only variable: IMPORTANTVAR % prv IMPORTANTVAR scalar-readonly IMPORTANTVAR=foo % typeset -T IMPORTANTVAR importantvar zsh: read-only variable: IMPORTANTVAR % prv IMPORTANTVAR scalar-readonly-tag_local IMPORTANTVAR=foo % prv importantvar array-tag_local importantvar=foo % importantvar=(buuz) % prv IMPORTANTVAR scalar-readonly-tag_local IMPORTANTVAR=buuz basically currently the readonly flag is bypasable this way for every var and therefore mood. Somehow i can't believe this is by design, instead of an overlook. Mit freundlichen Grüßen Thilo Six