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

Re: path PATH



On Sun, Jan 22, 2023 at 11:45 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> On 2023-01-22 13:11, Bart Schaefer wrote:
>
> > That's obviously not true, or it would not have been possible to write
> > describe-params.
>
> [...]
>
> (BTW, haven't run your version yet, waiting for Roman to sign off on it,
> but it will only get better.)

Me to sign off on Bart's code? Ha-ha :) I started using zsh in 2019
while Bart has been a contributor since the previous century. When
Bart and I disagree, it would be wise to go with his opinion by
default.

By the way, one thing bothers me about tied parameters. Is there
really no way (other than parsing the output of `typeset -p`) to
retrieve the name of the tied counterpart? Here's what I mean:

    % typeset -T FOO foo
    % tied-counterpart FOO
    foo
    % tied-counterpart foo
    FOO

How do you implement `tied-counterpart` that behaves as in the
(imaginary) transcript above?

Now that I think of it, there are a few more parameter properties that
aren't exposed through anything other than `typeset -p`.

    % typeset -i8 -R10 foo
    % typeset -p foo
    typeset -i8 -R10 foo=0
    % print -r -- ${(t)foo}
    integer-right_blanks

The numbers 8 and 10 cannot be retried from anywhere, right?

There is also at least one case where `typeset -p` is lossy.

    % typeset -F2 foo
    % typeset -p foo
    typeset -F foo=0.00

Note that the output is missing "2". Is this intended?

Roman.




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