From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 18370 invoked from network); 16 Apr 2020 18:06:15 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with UTF8ESMTPZ; 16 Apr 2020 18:06:15 -0000 Received: (qmail 2985 invoked by alias); 16 Apr 2020 18:06:08 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24785 Received: (qmail 23931 invoked by uid 1010); 16 Apr 2020 18:06:08 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f45.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25779. spamassassin: 3.4.4. Clear:RC:0(209.85.166.45):SA:0(-2.8/5.0):. Processed in 2.302324 secs); 16 Apr 2020 18:06:08 -0000 X-Envelope-From: pierpaolog@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.45 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2YmPgP+nDah5v0SDt65JEEVljy4riPlqs+WPRxj9tV4=; b=ewaG4noCPSu0WpRzxEPih2cM7jaf/SacwYf3i83BwFwcTsqYOSMiDH/wAM3G0VP7KJ G0+WbbvxXKgJrVJq3HNxbGwJqO2qlISQm8a7S5bHyVGcNKSmwS7QTgeD1xLxJxf//HHz tjAuqAq2pTDjMAm2DT3EwIxz5f+LzWFK7V/be+I6jSk710mYrO8JoALGJbpgBMWfgGne j6Rp/KTRIt+KCdA+I/pLyQ6DG7uQliB87iAbiBgfBrmk7T8qSXwnfe1VzB98MgUCUXkM uGkqNgI0H1ng7d8AuWl1z9XghKPTX1DWcXmONpsUJ8+IGzXdSg8kCaWSvzxhCo//LTsJ pDsQ== X-Gm-Message-State: AGi0PuY6v9NqJBA/cGhCvPO/A1nX4hW7+SyirZvrX4JKHyYMMyu2U+Q9 oScCGK16cJUekCNKQUiHYaoq2CMO8klOHA3jU6ghw1KkcKs= X-Google-Smtp-Source: APiQypLg7ahxpzJd09t/Et3nQIElYqTKzyO0QO2EWlNtJnkGA+ZWFGBcFMFnrE/VfV2hFTt0pRe18fgOb+LSfOzlPV8= X-Received: by 2002:a05:6602:5db:: with SMTP id w27mr20676214iox.152.1587060333855; Thu, 16 Apr 2020 11:05:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pier Paolo Grassi Date: Thu, 16 Apr 2020 20:04:57 +0200 Message-ID: Subject: Re: indirect assignment to array To: Sebastian Gniazdowski Cc: Mikael Magnusson , Zsh-Users List Content-Type: multipart/alternative; boundary="0000000000006fcdae05a36c47c1" --0000000000006fcdae05a36c47c1 Content-Type: text/plain; charset="UTF-8" >: ${(PA)varname::="$array[@]"} > >to not lose empty elements. this (very useful) clarification has made me embark in a three hour long quest to correct (some of?) the many places where I indeed was loosing empty elements thanks but I really hate when I find out bugs that i never have thought of (a big one has been discovering the -r flag to read) one should indeed always rtfm, and I really enjoy doing it, but there are so many to read and so few hours in a day... Pier Paolo Grassi Il giorno gio 16 apr 2020 alle ore 18:29 Sebastian Gniazdowski < sgniazdowski@gmail.com> ha scritto: > On Thu, 16 Apr 2020 at 01:14, Mikael Magnusson wrote: > >> : ${(PA)varname::=$array} >> (leave out the A for scalar assignment, and use AA for assoc arrays). >> > > I would do: > > : ${(PA)varname::="$array[@]"} > > to not lose empty elements. > > -- > Sebastian Gniazdowski > News: https://twitter.com/ZdharmaI > IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit > Blog: http://zdharma.org > --0000000000006fcdae05a36c47c1--