From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3807 invoked by alias); 16 Jun 2015 06:24: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: X-Seq: 35484 Received: (qmail 16193 invoked from network); 16 Jun 2015 06:24:17 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UZEIPjSZIgazFDc22gczJDj/tbO+hfvZXqSFsZl8fuY=; b=E12XsihiOLWNLmoObOp3IyYRvjfnym1VPE4SuebG2w2Vo7BziWoyDw4SU32iCM3TPF ALNupGACMJ9CwrTg6TZAjEji4qbTiU0Yse2Qzf3Hf8QYbd1KxtgR/QAgOFGPKCHMYXDw GieOmQH3dnwuxxZzGNI8URkyX2w28unyYZkEQq/5knUV9Y+yA3mEEP9W0C7S0wUc+vhL brH0tLRWJWxLk+Po6wn8+5h71CPxoONMIIoExE5s9Mdrj3pVaIaoZTtw8xlhSsOxnXTV 2arQdo/lQ4y9jWiiB/pxqm/8wDtb+xKtJFbvFa/CBrQAwzb1dtHNg/DRM7ZzWZXKsUtS 8iEw== MIME-Version: 1.0 X-Received: by 10.107.38.149 with SMTP id m143mr39708146iom.49.1434435852468; Mon, 15 Jun 2015 23:24:12 -0700 (PDT) In-Reply-To: <150615202431.ZM25744@torch.brasslantern.com> References: <131216114013.ZM25877@torch.brasslantern.com> <131217223651.ZM20980@torch.brasslantern.com> <20131218192816.047ab5f5@pws-pc.ntlworld.com> <131218235723.ZM4638@torch.brasslantern.com> <150615202431.ZM25744@torch.brasslantern.com> Date: Tue, 16 Jun 2015 08:24:12 +0200 Message-ID: Subject: Re: Read-only variables in emulation mode From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Tue, Jun 16, 2015 at 5:24 AM, Bart Schaefer wrote: > On Jun 16, 2:10am, Mikael Magnusson wrote: > } > } % echo hi; _=foo; echo $_ > } hi > } hi > > That's actually a bug -- the assignment _=foo should erase $_ , I think. > > } % for _ in a b c; do echo $_ hi; done > } hi > } hi hi > } hi hi > } > } I'm not sure if this is better than printing a warning that $_ is > } readonly. :) > > If you go back to the original message in the thread, the whole point > was to use $_ as a dummy variable that didn't need to be declared and > whose value was instantly discarded. For that purpose, the warning is > extraneous. > > Admittedly that's a pretty constrained use case. It's currently hooked up to nullstrsetfn, and was when it was readonly too, so I guess this never worked as intended. -- Mikael Magnusson