From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10658 invoked by alias); 5 Dec 2014 07:28:41 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33848 Received: (qmail 25026 invoked from network); 5 Dec 2014 07:28:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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== MIME-Version: 1.0 X-Received: by 10.50.7.38 with SMTP id g6mr1193054iga.42.1417764515221; Thu, 04 Dec 2014 23:28:35 -0800 (PST) In-Reply-To: <141203205120.ZM7564@torch.brasslantern.com> References: <141203205120.ZM7564@torch.brasslantern.com> Date: Fri, 5 Dec 2014 08:28:35 +0100 Message-ID: Subject: Re: PATCH: Explain array append a bit better From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Thu, Dec 4, 2014 at 5:51 AM, Bart Schaefer 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