zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: PATCH: pws-19: document minor syntactic innovation
Date: Tue, 01 Jun 1999 11:56:14 +0200	[thread overview]
Message-ID: <9906010956.AA18502@ibmth.df.unipi.it> (raw)
In-Reply-To: ""Bart Schaefer""'s message of "Mon, 31 May 1999 22:41:00 DFT." <990531224100.ZM8919@candle.brasslantern.com>

"Bart Schaefer" wrote:
> On May 23,  5:15pm, Peter Stephenson wrote:
> }   ${${${${(f)"$(typeset)"}:#*local *\=*}%%\=*}##* }

I should note that things like ${"foo"} only work by accident: you'll find,
for example, that ${"foo"%bar} doesn't work.  That would require swallowing
nulled out quotes at another point in paramsubst(), which I hinted at
before.  I didn't do this because I didn't see a use for it, but maybe it's
more consistent that way?

> What's the right way to document this change, including odd stuff like
> the above?

Here's a possible chunk for 3.1.5-pws-20.

> Should the FAQ recommend using this form in some circumstances because
> of the (@) change in 3.1.5?

Well, the new nested substitution section (3.22) is really about getting a
parameter evaluated as a parameter name and I'm not sure it's a good idea
to put in a lot of stuff about other flags and their uses, which could get
quite involved.  Maybe it needs a separate question, but I'm not sure I can
even remember the full effect of the changes.

--- Doc/Zsh/expn.yo.qt	Mon May 10 10:18:42 1999
+++ Doc/Zsh/expn.yo	Tue Jun  1 11:41:35 1999
@@ -502,6 +502,15 @@
 deleted.  The form with tt($LPAR())...tt(RPAR()) is often useful in
 combination with the flags described next; see the examples below.
 
+Note that double quotes may appear around nested quotations, in which case
+only the part inside is treated as quoted; for example, tt(${(f)"$(foo)"})
+quotes the result of tt($(foo)), but the flag `tt((f))' (see below) is
+applied using the rules for unquoted substitutions.  Note further that
+quotes are themselves nested in this context; for example, in
+tt("${(@f)"$(foo)"}"), there are two sets of quotes, one surrounding the
+whole expression, the other (redundant) surrounding the tt($(foo)) as
+before.
+
 subsect(Parameter Expansion Flags)
 cindex(parameter expansion flags)
 cindex(flags, parameter expansion)

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


  parent reply	other threads:[~1999-06-01 10:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-23 15:15 PATCH: pws-19: " Peter Stephenson
1999-05-29  8:31 ` Bart Schaefer
1999-05-31 22:41 ` Bart Schaefer
1999-06-01  6:23   ` Andrej Borsenkow
1999-06-01  8:21     ` Peter Stephenson
1999-06-01 12:52       ` Andrej Borsenkow
1999-06-01  9:56   ` Peter Stephenson [this message]
1999-06-01 17:44     ` PATCH: pws-19: document " Bart Schaefer
1999-06-02  8:03       ` Peter Stephenson
1999-06-02  8:44         ` sh compatibility " Andrej Borsenkow
1999-06-02  8:30           ` Peter Stephenson

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=9906010956.AA18502@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@sunsite.auc.dk \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).