From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14114 invoked by alias); 9 Dec 2017 00:23:18 -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: 42098 Received: (qmail 11322 invoked by uid 1010); 9 Dec 2017 00:23:18 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f175.google.com 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(209.85.216.175):SA:0(-1.9/5.0):. Processed in 2.075222 secs); 09 Dec 2017 00:23:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=2Wavx5XUqSheZBW52608pPxs0wtTgFkd6KBJSzodPvw=; b=EiBTt3lZCTb3shGgQi6DPgrOfLO5z9TIEqVnldm+uNUTcC74MPxEkKqTXU992x6dEB oQGFmlmjcO/44WFScvZ6tbLqWYNnGXnpfVlE0RgnSfjkja3SyA3JFV598FxBL6roGsRZ LscZprVi/4tfZd0arWn5kPsSx8/GTb32dTMeUSm6Fkjz92ihduTRJ1WglUFqpNKDHU2E B/k8OYpWX+c1l5gtfwzwiL3RZO2L43tjLx15R+NYZyVvutSa/LwGCHphtfMiYeBTf2J9 DxLvl68QXu6tgorvi2Z3JE39aZZIwHBpsnVH0K6aaiTO8kqh0NKMRM8Xu+3wZl84LVzw njiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2Wavx5XUqSheZBW52608pPxs0wtTgFkd6KBJSzodPvw=; b=DhZcq3C28ZqOUTwyNP2b7omq/f7ajdrbZPzrCrxWd3gBVma5BiYcrP2LyBlXWUu2Zg 4rXgKftrL/4b/AsIdgG34bn9hvpa+XUnQYQxGxJ3gmqWyswyBS4HG35un31OMKE/ko5F s88uAV1TSz6vSoDIwcdi0s6ddlMf1ieEXz5jyKfjiQkBIjGKJ176wXL4PFh+4r7Oc8nJ biR/OyE8ao8yoDh55BCSshA+CcYwptmHu/dgGmjnctKN+lPM/ciGvLJwzI92vVnT70ZT do0WroZyqx/xyPv3y0GPdLgCHhlhYWMnyM5tA3qsk4RYjYF2o1qqXllGHSESbsknjG/i NsYA== X-Gm-Message-State: AKGB3mIdvnnfJ5CNgc/epRjd//PXDcUX/rbGncAjZW2k5GjOK5Cqp7Ei 7uKGKHdxwJs2ihKLboxlJBLZGng3xaqYmYMHtXy58w== X-Google-Smtp-Source: AGs4zMaDZI2jRcpTbx9lDMQUCI/UtV7oxsn923vRPcMbutvU1FvZnOcBCPXUlf4FurKoJK4IbrRAuxsSB+5RqRacywA= X-Received: by 10.200.7.7 with SMTP id g7mr16838340qth.279.1512778992699; Fri, 08 Dec 2017 16:23:12 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <92FCFBAE-158C-4339-B374-275FD6ACDBE6@dana.is> References: <92FCFBAE-158C-4339-B374-275FD6ACDBE6@dana.is> From: Bart Schaefer Date: Fri, 8 Dec 2017 16:23:12 -0800 Message-ID: Subject: Re: [BUG] Tied parameters not restored correctly after pre-command re-assignment To: dana Cc: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" On Fri, Dec 8, 2017 at 2:51 PM, dana wrote: > > I found that, in 5.4.1 and 5.4.2-dev, tied parameters are not restored correctly > to their previous values if re-assigned in this way after calling a shell > function or built-in Several things: One, there's no implication that assigning to the array part of a tied variable will have any effect on the environment value of the scalar part unless you've explicitly exported the scalar. Two, exporting arrays is unsupported / undefined behavior, so using an array assignment as a command prefix is only sensible in contexts where all the execution takes place within the current shell (except see also item one). Three, if POSIX_BUILTINS is set there are different rules for how prefix assignments are handled for certain builtins vs. other cases, so you can't generalize from any particular experiment. % which printenv /usr/bin/printenv % typeset -xT ABC abc % abc=(a b c) printenv ABC a:b:c % typeset -p ABC export ABC='' % typeset -T CBA cba % cba=(c b a) printenv CBA % > % arr=( b c ) typeset -p SCA > typeset SCA=b:c > % typeset -p SCA > typeset: no such variable: SCA This works correctly if POSIX_BUILTINS is set, so I would guess it has some relation to the thread on zsh-workers about "local -r path".