From: Bart Schaefer <schaefer@brasslantern.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Oliver Kiddle <opk@zsh.org>, Zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: pcre callouts
Date: Tue, 31 Oct 2023 08:57:08 -0700 [thread overview]
Message-ID: <CAH+w=7bw6wbP5bq8ojGsJSfCiJqqkSfRtM+bYGS57HwR+r--3Q@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3SQ5Pt1HR2q75RTPg80iZjz5i5D=thgrcUJ=-C46s9q6Q@mail.gmail.com>
On Tue, Oct 31, 2023 at 6:31 AM Mikael Magnusson <mikachu@gmail.com> wrote:
>
> On 10/31/23, Bart Schaefer <schaefer@brasslantern.com> 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.
next prev parent reply other threads:[~2023-10-31 15:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 0:04 Oliver Kiddle
2023-10-31 3:26 ` Bart Schaefer
2023-10-31 3:40 ` Bart Schaefer
2023-10-31 13:31 ` Mikael Magnusson
2023-10-31 15:57 ` Bart Schaefer [this message]
2023-11-01 2:04 ` Oliver Kiddle
2023-11-03 3:47 ` Bart Schaefer
2023-11-03 9:50 ` Oliver Kiddle
2023-11-04 20:57 ` 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='CAH+w=7bw6wbP5bq8ojGsJSfCiJqqkSfRtM+bYGS57HwR+r--3Q@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=mikachu@gmail.com \
--cc=opk@zsh.org \
--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).