From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: Read-only variables in emulation mode
Date: Tue, 16 Jun 2015 08:54:52 -0700 [thread overview]
Message-ID: <150616085452.ZM26740@torch.brasslantern.com> (raw)
In-Reply-To: <CAHYJk3SyyZ8=b6p3YKaB5pwAJpVmC3_xBPM_iorbMx4pRJiriQ@mail.gmail.com>
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.
next prev parent reply other threads:[~2015-06-16 15:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-16 19:10 Øystein Walle
2013-12-16 19:40 ` Bart Schaefer
2013-12-18 6:36 ` Bart Schaefer
2013-12-18 19:28 ` Peter Stephenson
2013-12-19 7:57 ` Bart Schaefer
2015-06-16 0:10 ` Mikael Magnusson
2015-06-16 3:24 ` Bart Schaefer
2015-06-16 6:24 ` Mikael Magnusson
2015-06-16 15:54 ` Bart Schaefer [this message]
2015-06-16 21:06 ` Mikael Magnusson
2015-06-16 19:05 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=150616085452.ZM26740@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).