From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1IlAeT-0000FC-SP for garchives@archives.gentoo.org; Thu, 25 Oct 2007 21:54:06 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l9PLqmCb031811; Thu, 25 Oct 2007 21:52:48 GMT Received: from mail.marples.name (rsm.demon.co.uk [80.177.111.50]) by robin.gentoo.org (8.14.1/8.14.0) with ESMTP id l9PLni79027068 for ; Thu, 25 Oct 2007 21:49:45 GMT Received: from [10.73.1.30] (uberpc.marples.name [10.73.1.30]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.marples.name (Postfix) with ESMTP id E7218190100 for ; Thu, 25 Oct 2007 22:49:44 +0100 (BST) Subject: Re: [gentoo-dev] Opinions Wanted - Arrays again :) From: Roy Marples To: gentoo-dev@lists.gentoo.org In-Reply-To: <20071025213113.GJ29642@supernova> References: <1193326831.4245.16.camel@uberlaptop.marples.name> <20071025213113.GJ29642@supernova> Content-Type: text/plain Organization: Gentoo Date: Thu, 25 Oct 2007 22:49:19 +0100 Message-Id: <1193348959.2910.9.camel@uberpc.marples.name> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: be05df03-266e-4293-8cbf-437208e13eda X-Archives-Hash: a5d3e0721b368877fa6259adbd173f07 On Thu, 2007-10-25 at 14:31 -0700, Donnie Berkholz wrote: > Is there any way we could avoid these altogether, and instead use > separate variables for each array element? Well, we could prefix with numbers array="1.2.3.4 netmask 5.6.7.8; \* 'host.name' netmask 1.2.3.4 -I 'option; $FOO with spaces'" Would become 0_config_eth0="1.2.3.4 netmask 5.6.7.8;" 1_config_eth0="\*" 2_config_eth0="'host.name' netmask 1.2.3.4" 3_config_eth0="-I 'option; $FOO with spaces'" Can't suffix as we use $IFACE and $SSID and sometimes hardware addresses there. We don't have to have 0_, but we would need the other numbers. Advantage - no messy holding an array in a string Disadvantage - you have a big array and need to punt something in the middle :) OK, you could put a "value" in there but each array loop would have to know about this magical value. Thanks Roy -- gentoo-dev@gentoo.org mailing list