zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: PATCH: improve ${(q)...}
Date: Wed, 29 Apr 2009 17:42:37 +0100	[thread overview]
Message-ID: <200904291642.n3TGgbj5015904@news01.csr.com> (raw)
In-Reply-To: <090429093553.ZM9854@torch.brasslantern.com>

Bart Schaefer wrote:
> On Apr 29,  9:51am, Peter Stephenson wrote:
> I'm not necessarily thinking of any specific example.  With the current
> code, ${(qqq)${(qq)v}} produces "'foo'" which still has single quotes
> after one level of quotes is stripped.  If that's combined with another
> string that also contains single quotes, whether by directly adjacent
> concatenation or by interpolation inside a double-quoted string, etc.,
> those quotes might mean something.

I still can't see how this can have an effect, but I think it's moot
anyway.

> } I won't rely on my expectation here---it's different with backslash
> } quoting anyway.  However, you've certainly spotted a case I hadn't where
> } this changes the behaviour.  I can look for different letters...
> } Hmm, we could use qQ which is currently meaningless as a sort of
> } shorthand for "minimal quoting"...?
> 
> What does (qqQQ) mean, then?  Or (qQq)?  It'd probably be better to pick
> something that currently isn't even valid syntax, like (q-) ... I was
> all set to suggest (q1) (q2) etc. but (q0) already means "split at NULL
> bytes and then quote".  However, (q-) raises the question of what (-q)
> means, and whether (-) by itself means anything; the only character that
> is currently "attached" to a preceding flag is ":" and (q:EXPR:) seems
> like overkill.

(q-) seems harmless and - on its own can be a syntax error as at
present.  I can't see any problem with that.  All this means as a
precedent is it would probably be better never to add - as a flag on its
own, which I can live with.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


      reply	other threads:[~2009-04-29 16:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28 16:46 Peter Stephenson
2009-04-28 22:37 ` Bart Schaefer
2009-04-29  8:51   ` Peter Stephenson
2009-04-29 16:35     ` Bart Schaefer
2009-04-29 16:42       ` Peter Stephenson [this message]

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=200904291642.n3TGgbj5015904@news01.csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.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).