From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5393 invoked from network); 14 Oct 1999 15:08:55 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Oct 1999 15:08:55 -0000 Received: (qmail 26745 invoked by alias); 14 Oct 1999 15:08:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8257 Received: (qmail 26735 invoked from network); 14 Oct 1999 15:08:43 -0000 From: "Bart Schaefer" Message-Id: <991014150755.ZM21454@candle.brasslantern.com> Date: Thu, 14 Oct 1999 15:07:54 +0000 In-Reply-To: <199910141425.QAA16346@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "PATCH: Re: Associative array ordering and selective unset (Re: Example function)" (Oct 14, 4:25pm) References: <199910141425.QAA16346@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Wischnowsky , zsh-workers@sunsite.auc.dk Subject: Re: PATCH: Re: Associative array ordering and selective unset (Re: Example function) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 14, 4:25pm, Sven Wischnowsky wrote: } Subject: PATCH: Re: Associative array ordering and selective unset (Re: Ex } } Bart Schaefer wrote (in 5156, hah!): } } > typeset -A map } > map=('*.(gz|Z)' zcat } > '*.bz2' 'bzip2 -dc' } > '*.bz' 'bzip -dc' } > '*' '<') } > } > then ${map[(q)$argv[i]]} returns the value for the first subscript match } > found, and ${map[(Q)$argv[i]]} returns the array of values for every key } > that matches the subscript. } } This implements that -- but uses the characters `k' and `K' although I } don't know if this is better. I almost implemented this a while ago, but I stopped because of this: } scanparamvals(HashNode hn, int flags) } { } + if (!(prog = patcompile(tmp, 0, NULL)) || !pattry(prog, scanstr)) } + return; It just seemed so unpleasant to recompile the pattern for every key ... -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com