From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24699 invoked by alias); 15 Jun 2017 06:12:00 -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: 41303 Received: (qmail 26828 invoked from network); 15 Jun 2017 06:11:59 -0000 X-Qmail-Scanner-Diagnostics: from aok120.rev.netart.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(85.128.245.120):SA:0(0.0/5.0):. Processed in 1.251507 secs); 15 Jun 2017 06:11:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at zdharma.org does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new using ClamAV (18) Date: Thu, 15 Jun 2017 08:03:01 +0200 From: Sebastian Gniazdowski To: Bart Schaefer Cc: "=?utf-8?Q?zsh-workers=40zsh.org?=" Message-ID: In-Reply-To: References: Subject: Re: 5.3.1-dev-0 difference in =?utf-8?Q?array=3D(_?="${(PA@)var_name}" ) X-Mailer: Airmail (231) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline On 14-06-2017 at 22:35:51, Bart Schaefer (schaefer@brasslantern.com) wrote: > On Wed, Jun 14, 2017 at 10:09 AM, Sebastian Gniazdowski > wrote: > > Hello, > > % zsh-5.3.1 > > % var_name="abcdef"; array=( "${(PA@)var_name}" ); echo ${#array} > > 1 > > The (A) flag doesn't mean anything in this context in 5.3.1, that was > added about 2 months after the 5.3.1 release. I suspect it was this patch about using A outside ::= context. > So in the above example ${(P)var_name} returns a scalar and the (@) > flag is also meaningless. In this next example -- I think @ has an actual effect: > zsh-5.1.1 > abcdef=( a b ); var_name="abcdef"; array=( "${(PA@)var_name}" ); echo ${#array} 2 > ... array=( "${(P@)var_name}" ); echo ${#array} 2 > ... array=( "${(PA)var_name}" ); echo ${#array} 1 > ... array=( "${(P)var_name}" ); echo ${#array} 1 > resolve to nothing rather than to a quoted empty string, just as > "${emptyarray[@]}" would do. Yes it's a change for the better. -- Sebastian Gniazdowski psprint /at/ zdharma.org