zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: Bart Schaefer <schaefer@brasslantern.com>,
	Ray Andrews <rayandrews@eastlink.ca>
Cc: zsh Users <zsh-users@zsh.org>
Subject: Re: syntax question
Date: Fri, 23 Mar 2018 17:44:42 +0100	[thread overview]
Message-ID: <etPan.5ab52efa.50667f5b.159ee@zdharma.org> (raw)
In-Reply-To: <CAH+w=7ZYafX9MB0GcKnc5Cbj4GwR74KY196EcA6SZoSRUqiyLA@mail.gmail.com>

On 22 marca 2018 at 02:30:52, Bart Schaefer (schaefer@brasslantern.com) wrote:
> On Wed, Mar 21, 2018 at 4:15 PM, Ray Andrews wrote:
> > ${${(z)string}[1]}
> >
> > ${(z)string[1]}
> >
> > ... How can that mean anything different?
> 
> Operator precedence. The second one is equivalent to
> ${(z)${string[1]}}, as you observed.

Also, better to use (Az), utilizing your underrated patch, because:

% a='abcd'
% echo ${${(z)a}[1]}
a

-- 
Sebastian Gniazdowski
psprint /at/ zdharma.org


  reply	other threads:[~2018-03-23 16:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21 23:15 Ray Andrews
2018-03-22  1:30 ` Bart Schaefer
2018-03-23 16:44   ` Sebastian Gniazdowski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-08-30 19:13 zsh 5.1 released [user] Peter Stephenson
2015-09-06 16:50 ` syntax question Ray Andrews

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=etPan.5ab52efa.50667f5b.159ee@zdharma.org \
    --to=psprint@zdharma.org \
    --cc=rayandrews@eastlink.ca \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /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).