Hi, 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. Thanks, -- Leah Neukirchen <leah@vuxu.org> https://leahneukirchen.org/
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?
--
vq
> On 31 March 2022 at 06:49 Lawrence Velázquez <larryv@zsh.org> 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.
Peter Stephenson <p.w.stephenson@ntlworld.com> writes: > -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. This is way more clear indeed. -- Leah Neukirchen <leah@vuxu.org> https://leahneukirchen.org
On Thu, Mar 31, 2022, at 8:16 AM, Leah Neukirchen wrote:
> Peter Stephenson <p.w.stephenson@ntlworld.com> writes:
>
>> -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.
>
> This is way more clear indeed.
I concur, but I think the original message suggested clarifying the
completion blurb as well.
--
vq
On Thu, Mar 31, 2022 at 03:26:15PM -0400, Lawrence Velázquez wrote:
> On Thu, Mar 31, 2022, at 8:16 AM, Leah Neukirchen wrote:
> > Peter Stephenson <p.w.stephenson@ntlworld.com> writes:
> >
> >> -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.
> >
> > This is way more clear indeed.
>
> I concur, but I think the original message suggested clarifying the
> completion blurb as well.
That was addressed in 49932.
Wasn't sure if I should resurrect an 8 month old thread.
On Thu, Mar 31, 2022, at 8:11 PM, Matthew Martin wrote:
> On Thu, Mar 31, 2022 at 03:26:15PM -0400, Lawrence Velázquez wrote:
>> On Thu, Mar 31, 2022, at 8:16 AM, Leah Neukirchen wrote:
>> > Peter Stephenson <p.w.stephenson@ntlworld.com> writes:
>> >
>> >> -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.
>> >
>> > This is way more clear indeed.
>>
>> I concur, but I think the original message suggested clarifying the
>> completion blurb as well.
>
> That was addressed in 49932.
Argh, I even saw that one before I started and totally didn't connect
the dots.... *deep shame*
--
vq