Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Read-only variables in emulation mode
- X-seq: zsh-workers 35484
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Read-only variables in emulation mode
- Date: Tue, 16 Jun 2015 08:24:12 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- 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==
- In-reply-to: <150615202431.ZM25744@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAFaJEqs=P7yB-VGk=gJB2jzRf7zNiDkCuWWRADyY_xb52hGb_w@mail.gmail.com> <131216114013.ZM25877@torch.brasslantern.com> <131217223651.ZM20980@torch.brasslantern.com> <20131218192816.047ab5f5@pws-pc.ntlworld.com> <131218235723.ZM4638@torch.brasslantern.com> <CAHYJk3QtwxXabmsuYz_D-EcWSkmhLn_XWkPUnhiOU7VDdZLTPg@mail.gmail.com> <150615202431.ZM25744@torch.brasslantern.com>
On Tue, Jun 16, 2015 at 5:24 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author