Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _brace_parameter: misleading help text for #
> On 31 March 2022 at 06:49 Lawrence Velázquez <larryv@xxxxxxx> wrote:
>
>
> On Thu, Jul 22, 2021, at 9:35 AM, Leah Neukirchen wrote:
> > echo ${(<TAB> shows
> > ...
> > # -- evaluate as numeric expression
> > ...
> >
> > zshexpn(1) says:
> > # Evaluate the resulting words as numeric expressions and output
> > the characters corresponding to the resulting integer.
> >
> > I think the help text is missing the crucial bit here:
> > output the characters corresponding to the resulting integer.
> >
> > Perhaps
> > "#:evaluate as numeric expression and interpret as character codes"
> > or so would be a better description.
>
> Apologies, Leah. This hasn't been addressed, as far as I can tell.
>
> workers: Anyone want to take a stab at it?
Yes, that's a good idea --- I think this sort of thing has confused me
in the past.
I'm wondering if the use of the phrase "the resulting words" is clear.
It is explained at the top of parameter expansion, so I'm probably
worrying about nothing --- i.e. it's already explicit that something
like "32 65" is just one word unless you're in one of the cases where
the shell does splitting on it. The phrase occurs repeatedly in this
area, so it would need explaining higher up if it wasn't clear. But
I'll leave it alone unless anyway else thinks they're confused.
pws
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 00cbbcd27..bbacc6ae4 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -968,9 +968,10 @@ following flags are supported:
startitem()
item(tt(#))(
-Evaluate the resulting words as numeric expressions and output the
-characters corresponding to the resulting integer. Note that this form is
-entirely distinct from use of the tt(#) without parentheses.
+Evaluate the resulting words as numeric expressions and interpret
+these as character codes. Output the corresponding characters. Note
+that this form is entirely distinct from use of the tt(#) without
+parentheses.
If the tt(MULTIBYTE) option is set and the number is greater than 127
(i.e. not an ASCII character) it is treated as a Unicode character.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author