From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20228 invoked by alias); 16 Jun 2015 15:55:00 -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: 35488 Received: (qmail 23362 invoked from network); 16 Jun 2015 15:54:58 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=i5OZnHzr9BmfL5pR4kmTUEGK89Jw+nL067ozCekSnXE=; b=D1i6dfF6AjqoCoeWNP5OX6om5oFRjOGM6jrPSlvmOAWIi6FYV+i1VgCR/2a7qJluM8 rsQazk+ZHgDLhmsNBdh8oJxnT4ky+K8+x9cAOHVWZkolAhm1i1YFLA8y6yWVzf4Mze1p 5jSeYAgeG1DnOqv/fri5Sa3emzelBc0lQB4w6SnTLDyN/0R788iKRH9twGWYT/GqAqkK b9QbdmBKI3UGKS7kxxDT/2352kkVdhlmjthTQfo5Pvs7bls3CQ1+DNcZbgw0h04A37Ga d8iCITp5/U9O/yOzqRofoU9AqsPB8pno8byPsQSv8SvkPthXpYd/SKXfmP4d5JnQGSW9 P/Lw== X-Gm-Message-State: ALoCoQmSC78f7o34mtAvZodzJB3LV1IHHm8jbPPLpbCKVHnON88v9+i3kk/PCocKQDXVpWkqkFZ3 X-Received: by 10.60.39.230 with SMTP id s6mr829064oek.21.1434470096402; Tue, 16 Jun 2015 08:54:56 -0700 (PDT) From: Bart Schaefer Message-Id: <150616085452.ZM26740@torch.brasslantern.com> Date: Tue, 16 Jun 2015 08:54:52 -0700 In-Reply-To: Comments: In reply to Mikael Magnusson "Re: Read-only variables in emulation mode" (Jun 16, 8:24am) 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> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: Read-only variables in emulation mode MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 16, 8:24am, Mikael Magnusson 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 } > } > 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. } } It's currently hooked up to nullstrsetfn, and was when it was readonly } too, so I guess this never worked as intended. I'm not sure what "never worked as intended" is aimed at. "That's actually a bug" -- $_ should be erased because there is no command for a last argument to be taken from, not because it's been assigned foo. "use $_ as a dummy variable" -- that didn't work as intended before, but it does now. So what never worked and what was intended? As with $0 in the other thread, "local -h _" works.