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

Re: List of pending patches



> - Drop some reference specific code from typeset - workers/55046

I've not applied this because it appears to duplicate parts of 55026
-- can you provide another updated patch?

Updated patch in workers/55109.

> - Don't map ksh's ! to Zsh's (!k), map it to (k) - workers/55047

I've applied the first patch but not yet the "DO NOT COMMIT" patch.
However, I'm inclined to agree with your assessment in workers/55091
after reviewing your table.

I will look into turning the "DO NOT COMMIT" patch into a proper one.
 
> - Forbid break/continue in subshells - workers/55061

Included the first patch, but not the second ("break N" would error
for oversize N).

See alternate version of the second patch in workers/55114.

> - Fix named reference documentation - workers/55069

Applied, but I have a niggle with this bit:

+A named reference declared with the `tt(-n)' option to any of the
+`tt(typeset)' commands acts as a reference to another parameter, which

"A named reference ... acts as a reference" reads wrong to me,  The
original sentence "A named parameter declared with ..." intentionally
did not introduce the term "named reference" until after "acts as a
reference" had been stated.  (The original term "named parameter" was
differentiating from "positional parameter" in context.)

Here is the original paragraph: 

A named parameter declared with the ‘-n’ option to any of the ‘typeset’ acts as a reference to another parameter, which may be at a different call level than the declaring function. When the ‘-u’ option is also given, the referenced parameter is always found at a call level above the function where the reference is declared, otherwise the reference scope is dynamic. For this reason, it is good practice to declare a named reference as soon as the referent parameter is in scope, and as early as possible in the function if the reference is to a parameter in a calling scope.

I find the term "named parameter" problematic because it comes out of nowhere. The paragraph just above starts with "Parameters declared by any of the ‘typeset’ family of commands …". There it's just "parameters" even though it talks about named parameters and not positional ones. Another issue with the original paragraph is that the first sentence introduces references without mentioning the term "named references" but that term is then later used without any introduction and in my opinion it's not necessarily clear what it refers to.

That being said, I wasn't too happy about my reformulation. I will try to find something better.
 
> - Reorder the documentation of typeset flags - workers/55070
>   Only documentation

I've not applied this yet because I'm not entirely happy with moving
'-n' into the list of parameters with everything else.  The
introduction to `typeset` looks like this:

typeset [ {+|-}AHUaghlmrtux ] [ {+|-}EFLRZip [ N ] ]
        [ + ] [ NAME[=VALUE] ... ]
typeset {+|-}n [ -g ] [ {+|-}r ] [ NAME[=VALUE] ... ]
typeset -T [ {+|-}Uglrux ] [ {+|-}LRZp [ N ] ]
        [ + | SCALAR[=VALUE] ARRAY[=(VALUE ...)] [ SEP ] ]
typeset -f [ {+|-}TUkmtuz ] [ + ] [ NAME ... ]

This implies that there are four different entities being managed:
"normal" parameters with all their bells and whistles; named
references; tied parameters; and functions.  Rearranging the
documentation to mix all of the "flags" into one table discards these
distinctions.  (Yes, I acknowledge that '-f' is already "in the wrong
place" from this standpoint.)

One reason for the change is that the first time I looked for the documentation of -n, it took me ages to finally find it buried in one of the paragraphs; I looked for it in the list flags, failed to find it, assumed that I must have misunderstood that such a flag exists, then found again (probably in the paragraph mentioned above) that it does exist, and finally found it after carefully reading the whole documentation of typeset.

I will try to address the issue, maybe by simply mentioning early in the documentation that -f, -n, and -T are very special.

Noting for reference that the intro needs -H and -h added to to
`typeset {+|-}n ...` too.

I will add them.

Philippe



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