Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Named reference typos & misc.
- X-seq: zsh-workers 51435
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Named reference typos & misc.
- Date: Tue, 14 Feb 2023 16:36:49 +0000 (GMT)
- Archived-at: <https://zsh.org/workers/51435>
- Importance: Normal
- In-reply-to: <CAH+w=7Y5=OvRTCCHahaMc9+n8XFrOSiSwrkXd86AdToU4N7QNA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YRxyV6sj4eobpgo3aEgw3MOZj6jJ9bhi+acJn=ywbVAA@mail.gmail.com> <1249162537.4244630.1676386019653@mail.virginmedia.com> <CAH+w=7Y5=OvRTCCHahaMc9+n8XFrOSiSwrkXd86AdToU4N7QNA@mail.gmail.com>
On 14/02/2023 16:14 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Tue, Feb 14, 2023 at 6:47 AM Peter Stephenson
> <p.w.stephenson@xxxxxxxxxxxx> wrote:
> >
> > I need the following to make the tests pass --- else no error message.
>
> I get a passed test with or without the "unsetopt typeset_to_unset".
>
> Is there some way this could be platform-dependent?
Was wondering; this is pretty old, Ubuntu 16.04, x86_64. I don't have
anything bang up to date but I've got some alternatives I can try.
Here's a minimal case:
zsh -fc 'setopt typeset_to_unset
setopt warn_nested_var
unset one
typeset -n ref
() {
typeset one=ONE
for ref in one; do
: ${ref}
done
}'
No error message; sticking an "un" at the start makes it appear.
I kept the loop in the function to avoid a (correct) additional warning
message setting the global variable ref in the loop. I don't know if
setting ref in a for loop should actually elide that message, which
is a completely separate issue.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author