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

Re: a few question about named reference



On Sat, Jul 15, 2023 at 10:10 PM Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
>
> >> So we can't remove the readonly attribute (and will not be able
> >> to remove/unset it). Is this intentional?
> >
> > Yes, that's how it works in ksh.
>
> With ksh (Version AJM 93u+m/1.0.4 2022-10-22):
> $ typeset -n -r ref=i
> ksh: typeset: -n cannot be used with other options except -g

Hmm.  My previous reference was ksh88.  The ksh93 I have installed is
a bit older and doesn't have a -g option at all.  Looks like they're
borrowing stuff from zsh, now?

> But it's OK if it is intentional.

Upon reflection and for consistency with other parameter types, it
does seem like +r should be allowed.  There also aren't any test for
readonly namerefs, I should add a couple.




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