Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: path PATH
On 2023-01-29 20:41, Bart Schaefer wrote:
The explicit purpose of the hideval attribute is to prevent "typeset
-p" (and several other things) from displaying/restoring the value.
Interesting, that's a logical dilemma. It's like writing into the
constitution that the constitution cannot be changed. So then (my
imaginary version):
1 /aWorking/Zsh/Source/Wk 0 $ typeset -Hi zzz=123
1 /aWorking/Zsh/Source/Wk 0 $ typeset -p zzz
typeset -Hi zzz=123
$ typeset -Hi zzz=456 # New value for zzz.
... very understandable that some vars should be hidden 'normally' but
does that mean you have to start a new terminal to edit 'zzz'? -- that
the country must be dissolved in order to change it's constitution?
Usually there's a way to amend the constitution. So, in the same
spirit, my lines above would seem to me to be the one and only legal way
to view and edit zzz. Or, it could be decided that zzz can *never* be
viewed. But then never edited as well? One thing I'd say for sure:
(real code):
1 /aWorking/Zsh/Source/Wk 0 $ typeset -Hi zzz=123
1 /aWorking/Zsh/Source/Wk 0 $ typeset -p zzz
typeset -i zzz
... that's simply wrong. Hiding the '-H' merely fools you into thinking
zzz is a plain integer with no value and that's not correct. My v() does:
1 /aWorking/Zsh/Source/Wk 0 $ v zzz
Iv zzz = !hidden!
... so at least you see the attributes correctly ( I should use the
'real' single letters that typeset uses) even if you are still forbidden
to see the value. It's a design decision of course, but IMHO every
locked door has a key, every constitution can be amended and every var
should be viewable and editable even if (in this case) only by explicit
exception. Is there really no way at all to see the value of a
hideval? Surely there is.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author