Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: pcre callouts
- X-seq: zsh-workers 52259
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: Oliver Kiddle <opk@xxxxxxx>, Zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: pcre callouts
- Date: Tue, 31 Oct 2023 08:57:08 -0700
- Archived-at: <https://zsh.org/workers/52259>
- In-reply-to: <CAHYJk3SQ5Pt1HR2q75RTPg80iZjz5i5D=thgrcUJ=-C46s9q6Q@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <72311-1698710659.978677@cDMN.pAu_.Ex7V> <CAH+w=7bNAmZP3x+4n1qYCQBQiTM+9TZgTumVXnAftoeFcHcToA@mail.gmail.com> <CAH+w=7aaS8ZHQ8Rd=ZPh8cnMu-Yg_gR2TOT2YnXvdGk337-WYw@mail.gmail.com> <CAHYJk3SQ5Pt1HR2q75RTPg80iZjz5i5D=thgrcUJ=-C46s9q6Q@mail.gmail.com>
On Tue, Oct 31, 2023 at 6:31 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> On 10/31/23, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> >
> > It occurs to me that if you create a scope, you could also create $_
> > in that scope with PM_HIDE set, and then use $_ directly with no
> > namespace needed.
>
> Wouldn't any code inside need to immediately store the value of $_ in
> another parameter to avoid overwriting it after the first command?
PM_HIDE is "local -h" ... if that's set the global value of $_ will
change after every command but the local scope won't be able to see
it. Seems to work in a quick function example I tried.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author