Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to have function local variable but must behave just a simple one
- X-seq: zsh-users 29207
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: How to have function local variable but must behave just a simple one
- Date: Sat, 26 Aug 2023 22:58:27 +0200
- Archived-at: <https://zsh.org/users/29207>
- In-reply-to: <522ad88e-adb2-74a7-103b-62af0f3e7b4e@eastlink.ca>
- List-id: <zsh-users.zsh.org>
- References: <CAH0GyZAfvds3Ztby301R+3dp0WuFWNn=0bLAQ+h5Stvp4z9tOQ@mail.gmail.com> <CAN=4vMr9UjvPAJNRW8i6xviCwy-aLTb+oKoO3Y+Y-wnYzGLc7w@mail.gmail.com> <CAH+w=7YM0dFNLKJo1E1w29zHCfv909gGvRCAd=LqUcqWcaHTWA@mail.gmail.com> <522ad88e-adb2-74a7-103b-62af0f3e7b4e@eastlink.ca>
On Sat, Aug 26, 2023 at 10:39 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> On 2023-08-26 13:26, Bart Schaefer wrote:
> > On Sat, Aug 26, 2023 at 12:34 AM Roman Perepelitsa
> > <roman.perepelitsa@xxxxxxxxx> wrote:
> >> Zsh doesn't have the equivalent. You'll have to use a global parameter.
>
> Why not have a global variable [...]
Indeed, given that in zsh there are no function-scoped parameters that
outlive an invocation of the function, Budi will have to use a global
parameter and take necessary precautions to ensure the name of the
parameter does not clash with other globals.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author