Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Explain array append a bit better
- X-seq: zsh-workers 33848
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: Explain array append a bit better
- Date: Fri, 5 Dec 2014 08:28:35 +0100
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9q3hmlcdhpPzmOC9M/0rjwxklKKubqM07xF0QcKENkk=; b=Gd9wxBABRg5o9Dmhaz1AtQoyAqi1uZfjMLnQ0XFlQ02yIQ7L+zndvidREiXjs9i1KM DAwE2/367/yrRZNncbncm7iZS32shUerBtiirbDpT8SH9AD2DhiYxXsQ0EEsLzehRiZB dSrl2i/VJFzJoV4V+wsFiVUyMN9O/nP1ZbeRLG2AqHgSj0IUTfVcgNalVOkoK5c4tkTt Ls4ND7HvOIWISaqGd1m1kUL+pDiKnNIV37ur7nqO9nzP3vL3DIsmpYk+l24v56Voghp8 LRYaabu6K9DG+8FbjsJfor8h25LFUNpIKc4DRuUINC6+fxAr9JcWQqbyXYYja6rhoHuW 4sJw==
- In-reply-to: <141203205120.ZM7564@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <141203205120.ZM7564@torch.brasslantern.com>
On Thu, Dec 4, 2014 at 5:51 AM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author