zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: Explain array append a bit better
Date: Fri, 5 Dec 2014 08:28:35 +0100	[thread overview]
Message-ID: <CAHYJk3R49_MSWWQQ_HTb-iFWnZQ_99LUeLKrVbC8WA=a8AeLgg@mail.gmail.com> (raw)
In-Reply-To: <141203205120.ZM7564@torch.brasslantern.com>

On Thu, Dec 4, 2014 at 5:51 AM, Bart Schaefer <schaefer@brasslantern.com> wrote:
> My apologies if this is a duplicate, I was in the middle of sending it
> when my desktop box briefly lost contact with the UPS due to a USB
> error and decided that this meant power was failing and it needed to
> shut down.  I don't see it in the archives so I presume it didn't go.
>
> This moves the description of the "+=" assignment up to the intro where
> other assignments are discussed, and explains "appending" to associative
> arrays.

Should we perhaps mention array prepending somewhere too? I read the
sections "Array Subscripts" and "Array Element Assignment", and
searched for the string 1,0 and came up with nothing.

diff --git i/Doc/Zsh/params.yo w/Doc/Zsh/params.yo
index 5833d6b..cd09d70 100644
--- i/Doc/Zsh/params.yo
+++ w/Doc/Zsh/params.yo
@@ -99,6 +99,11 @@ the syntax:
 ifzman()
 indent(var(name)tt(+=LPAR())var(value) ...tt(RPAR()))

+To prepend to an array, use the syntax (requires that tt(KSH_ARRAYS)
+and tt(KSH_ZERO_SUBSCRIPT) are not set):
+ifzman()
+indent(var(name)tt([)var(1,0)tt(]=LPAR())var(value) ...tt(RPAR()))
+
 Ordinary array parameters may also be explicitly declared with:
 findex(typeset, use of)
 ifzman()


-- 
Mikael Magnusson


  reply	other threads:[~2014-12-05  7:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04  4:51 Bart Schaefer
2014-12-05  7:28 ` Mikael Magnusson [this message]
2014-12-05  8:05   ` Bart Schaefer
2014-12-05 12:25   ` Oliver Kiddle

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='CAHYJk3R49_MSWWQQ_HTb-iFWnZQ_99LUeLKrVbC8WA=a8AeLgg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@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).