Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Hiding specials, and namerefs
- X-seq: zsh-workers 55019
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Hiding specials, and namerefs
- Date: Tue, 21 Jul 2026 21:18:31 -0700
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yzkl+ZJdGoYzfEc7mReKamONtbTzS1M8yyy0EKsoTVs=; fh=BgAYDYpL6Ne/A5nWEMVJiHiBtrz8Imz3uf26RDwgQX4=; b=cEKfzh38XI/AHh/TkzTn804lXleT43v95Dyyc2jIObnZAl9tYA5hpVZyUcfVXGu5Na wEN4sGuhoqaO/QSeHz9SXJyzLxngCfw7xM/Lzytif5JKO/ds1bR6agZOTuUcR825a+83 NauwuUcAXUiAyNYdJKdBHrMB0unNBdyzj30yAtpa4gsiUwCxUFfWTIX0nGYzJ1pJgqGu jrcCKI5e5S2iHIuFtU8F1r0b/dSQsYJ+h4TDFhDz6DA4+C4JOwoTGZSmPaMXf+x0Gn7c tQt0RfPyxbdeWpmwYYeCEViBTA4X1YgzToYwrfo383Ea8wLE82IGHhyAA10MC3bnwTDu AUhg==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1784693923; cv=none; d=google.com; s=arc-20260327; b=aVtPLoyOZxM4oWBBRilD9pqT5D0x1pBcNeJp2+fch38RBFR1ZBrsGdNgmFzPQYbBNH /Xe70W4vtrcpyNOqmuEnFTl/C9mKY9XlFS/skB26zVBnrqSQ83psjAtNsyNqQIE4hSvO tkWTA/0DWmnmQoIdxyNpiJ1N0+IO1knkGtwKVWy6Jk04tkoAfIxSPiFjfSTdVdE65gZB ve1UxnjAHt6rqEggFzaRtr9v5lcz0RCjA/Ta4j0THB+LImpkuMcQplmkYTQwN9/6gAkb pULXJM0vPC1h9ABq0uLKEwT+RrS95JXReWA7rvqdxG3uh5mK/VrXv2+w1EHzW6pFQEah sTpQ==
- Archived-at: <https://zsh.org/workers/55019>
- In-reply-to: <CAH+w=7YqtTKZSkmd3Q=B5UkJJ=iih1NbWJ7Jn=P02fJudo+TWA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7ZVUPRKBpRVOGX4eSqbKNFyt8PrYC4r37GMGu1KJO8Egg@mail.gmail.com> <CAHYJk3SP_uEk8YTCpExj2fYi7uKyMRYA389zUWVyUGqx+VhJ=Q@mail.gmail.com> <CAH+w=7YqtTKZSkmd3Q=B5UkJJ=iih1NbWJ7Jn=P02fJudo+TWA@mail.gmail.com>
Answering some of my own questions, asking new ones ...
On Tue, Jul 21, 2026 at 4:51 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> B02typeset.ztst
> (eval):typeset:3: SRANDOM: can't change type of autoloaded parameter
> Was testing: Global -h variable doesn't hide autoload variable
>
> I think this one exemplifies the change, the use of -h shouldn't be a
> silent no-op. Thoughts?
Clarification here. The restriction on -h only applies when
attempting to change the attribute ("type" in the error message is
wrong, I've corrected) on an existing parameter. That applies to
this test because it uses -gh. If the -g is removed, a new local is
being created and that is definitely allowed to hide the special from
the surrounding scope. I think I have that working.
New question: Should there be just a warning in this case, or an
actual error? An error would change the behavior.
While testing this I discovered that the same (silent no-op) behavior
applies to "typeset -gn" for specials, and for autoloads we get e.g.
this:
% typeset -gn SRANDOM
zsh: invalid variable name: zsh/random
I'll see if I can track that down.
> Why does it ever make sense to apply -h to a global? What's the point
> of this test?
I still have this question.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author