Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Question on unintuitive behaviour for function execution and parameter assignment
- X-seq: zsh-workers 49481
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Question on unintuitive behaviour for function execution and parameter assignment
- Date: Wed, 13 Oct 2021 10:10:36 +0100 (BST)
- Archived-at: <https://zsh.org/workers/49481>
- Importance: Medium
- In-reply-to: <6uviEgEHuYei0UyfGfR_mqJvrNcXyJ5zfUwrQViRtmWwGeZwRR1C26lsUK9_D-V_GzCg5cG2gQ2IwHxScwLySDcy71rAa2RMpK5XF8BvtkE=@pm.me>
- List-id: <zsh-workers.zsh.org>
- References: <78LG0jAMo3FtN941LSwAK1kIhfcF6dszDg8-71F1TxHB3vKubQBIIAWx8yujorTI1mEI8iq4Rsahakh7IfgcNXdq2KMviv805m0imzBh5Sk=@pm.me> <917132892.507659.1634027485386@mail2.virginmedia.com> <6uviEgEHuYei0UyfGfR_mqJvrNcXyJ5zfUwrQViRtmWwGeZwRR1C26lsUK9_D-V_GzCg5cG2gQ2IwHxScwLySDcy71rAa2RMpK5XF8BvtkE=@pm.me>
> On 13 October 2021 at 09:42 Jett Husher <jetthusher@xxxxx> wrote:
> On Tuesday, October 12th, 2021 at 10:31, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> > This is covered by the POSIX_BUILTINS option. Generally, the POSIX_* options are
> >
> > the place to look for this sort of think --- granted that can be a bit of hunt.
>
> I wouldn't even think to look at POSIX_* variables because POSIX-2017
> explicitly tells that it's unspecified "Whether or not the variable assignments persist after
> the completion of the function", so, naturally, I though that this behaviour was compliant.
It's always worth (everyone) bearing in mind that zsh is not a POSIX shell by default.
In fact, it's not *completely* POSIX even in sh emulation, as this has been gradually
retrofitted, and not everything can be done within the current constraints.
cheers
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author