From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13268 invoked from network); 27 May 2006 18:49:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.2 (2006-05-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.2 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 May 2006 18:49:59 -0000 Received: (qmail 73927 invoked from network); 27 May 2006 18:49:51 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 May 2006 18:49:51 -0000 Received: (qmail 29274 invoked by alias); 27 May 2006 18:49:44 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10317 Received: (qmail 29264 invoked from network); 27 May 2006 18:49:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 27 May 2006 18:49:43 -0000 Received: (qmail 72926 invoked from network); 27 May 2006 18:49:43 -0000 Received: from snaefell.rhi.hi.is (130.208.165.28) by a.mx.sunsite.dk with SMTP; 27 May 2006 18:49:42 -0000 Received: from jin.myrkraverk.com (a048.nemendur.hi.is [130.208.188.48]) by snaefell.rhi.hi.is (8.13.6/8.13.3) with ESMTP id k4RInMq1023927 for ; Sat, 27 May 2006 18:49:23 GMT Received: from jin.myrkraverk.com (localhost.localdomain [127.0.0.1]) by jin.myrkraverk.com (8.13.1/8.13.1) with ESMTP id k4RJ9qdR021773 for ; Sat, 27 May 2006 19:09:52 GMT Received: (from myrkraverk@localhost) by jin.myrkraverk.com (8.13.1/8.13.1/Submit) id k4RJ9ph8021772; Sat, 27 May 2006 19:09:51 GMT X-Authentication-Warning: jin.myrkraverk.com: myrkraverk set sender to johann@myrkraverk.com using -f Subject: Re: Keying arrays to names: is there an array of arrays? References: <44771E3E.9070102@ulpmm.u-strasbg.fr> <200605261540.k4QFeReG007573@news01.csr.com> From: "Johann 'Myrkraverk' Oskarsson" To: zsh-users@sunsite.dk Date: Sat, 27 May 2006 19:09:51 +0000 In-Reply-To: <200605261540.k4QFeReG007573@news01.csr.com> (Peter Stephenson's message of "Fri, 26 May 2006 16:40:27 +0100") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Peter Stephenson writes: > This reminds me I was going to post a general solution along the same > lines which deals with embeded spaces etc.: Is it possible to abstract that trick into functions? That is, so the function takes the array name, key, and value as arguments? My feeble attempts have failed. > % array=(one 'two three' '"four five six"') > % typeset -A hash > % array=(${(q)array}) > % hash[key]="${array}" > % array=(${(Q)${(z)hash[key]}}) > % print -rl $array > one > two three > "four five six" Johann -- johann myrkraverk com (you know the drill with the @ and .) I classify Outlook mail as spam, use something else.