From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29842 invoked from network); 5 May 2009 16:06:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 May 2009 16:06:30 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 19029 invoked from network); 5 May 2009 16:06:05 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 May 2009 16:06:05 -0000 Received: (qmail 26948 invoked by alias); 5 May 2009 16:05:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26927 Received: (qmail 26876 invoked from network); 5 May 2009 16:05:34 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 5 May 2009 16:05:34 -0000 Received: from cork.scru.org (cork.scru.org [209.20.67.2]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 24C0580590A3 for ; Tue, 5 May 2009 18:04:39 +0200 (CEST) Received: by cork.scru.org (Postfix, from userid 1000) id EDCE810494D; Tue, 5 May 2009 16:05:28 +0000 (UTC) Date: Tue, 5 May 2009 16:05:28 +0000 From: Clint Adams To: martin f krafft , 526924@bugs.debian.org Cc: zsh-workers@sunsite.dk Subject: Re: Bug#526924: zparseopts: should use lists as values in assoc array Message-ID: <20090505160528.GB19068@scru.org> Mail-Followup-To: martin f krafft , 526924@bugs.debian.org, zsh-workers@sunsite.dk References: <20090504130124.GA13947@piper.oerlikon.madduck.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090504130124.GA13947@piper.oerlikon.madduck.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.92.1/9328/Tue May 5 14:49:32 2009 on bifrost X-Virus-Status: Clean On Mon, May 04, 2009 at 03:01:24PM +0200, martin f krafft wrote: > piper:~|master|% set -- -a1 -a2; zparseopts -A arr a+:; echo $arr[-a] > 12 > > Unfortunately, this greatly reduces the usefulness of the builtin, > since it's impossible to tell from the hash value whether the > options where -a1 -a2 or -a12. > > It would be better if the value pointed to by the hash would contain > a list, such that $arr[-a] in the above would be (1 2). Unfortunately we don't handle arrays as values of associate arrays (yet?) but you can do something like set -- -a1 -a2; zparseopts 'a+:=arr'; print -l $arr although this seems to set arr=(1 -a 2), which is not what I expected to happen.