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



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