Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: path PATH



On Sun, Jan 22, 2023 at 2:03 PM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> I think it would be better for this function to pretend that those
> function-scoped parameters don't exist.

I'm not happy about that because there's no way to distinguish them
without hard-coding a list of names, which (unlikely as this might be)
is not future-proof.

If they were tagged -local in $parameters that would make more sense
(but that'd mean adding a bunch of extra cases to zsh/parameter, it
just moves the problem).

And $? $_ $- aren't really function-scoped anyway.

> If it were a builtin, it could
> describe parameters such as `ARGC` or `1` in a way that makes sense

Don't have to worry about positionals, they're not in $parameters to begin with.

> but here the caller can only get confused if any answer is returned
> for them at all.

There's no reason not to return the ${(t)...} info.  I'm tempted to
just decide that if that includes "special" then any reported value is
caller-beware.




Messages sorted by: Reverse Date, Date, Thread, Author