zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Leah Neukirchen <leah@vuxu.org>, zsh-users@zsh.org
Subject: Re: _brace_parameter: misleading help text for #
Date: Thu, 31 Mar 2022 09:42:19 +0100 (BST)	[thread overview]
Message-ID: <1929934417.782788.1648716139543@mail2.virginmedia.com> (raw)
In-Reply-To: <4ede1b1e-f441-4b67-bc30-158c3397ca1d@www.fastmail.com>

> 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.


  reply	other threads:[~2022-03-31  8:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 13:35 Leah Neukirchen
2022-03-31  5:49 ` Lawrence Velázquez
2022-03-31  8:42   ` Peter Stephenson [this message]
2022-03-31 12:16     ` Leah Neukirchen
2022-03-31 19:26       ` Lawrence Velázquez
2022-04-01  0:11         ` Matthew Martin
2022-04-01  0:21           ` Lawrence Velázquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1929934417.782788.1648716139543@mail2.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=leah@vuxu.org \
    --cc=zsh-users@zsh.org \
    --subject='Re: _brace_parameter: misleading help text for #' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).