From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3840 invoked from network); 19 Jul 1999 01:01:44 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Jul 1999 01:01:44 -0000 Received: (qmail 29171 invoked by alias); 19 Jul 1999 01:01:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7187 Received: (qmail 29164 invoked from network); 19 Jul 1999 01:01:31 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: string range between 1 and 0. References: <990719000259.ZM8741@candle.brasslantern.com> MIME-Version: 1.0 (generated by AKEMI 1.13.2 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCQTA0Y0s8GyhCIg==?=) Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 19 Jul 1999 10:01:29 +0900 In-Reply-To: "Bart Schaefer"'s message of "Mon, 19 Jul 1999 00:02:59 +0000" Message-ID: User-Agent: Chao-gnus/6.12.5 AKEMI/1.13.2 (=?ISO-2022-JP?B?GyRCQTAbKEI=?= =?ISO-2022-JP?B?GyRCNGNLPBsoQg==?=) FLAM-DOODLE/1.12.6 (=?ISO-2022-JP?B?GyRCM3cbKEI=?= 10R4.0/5.0) Emacs/20.3.11 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN) In article <990719000259.ZM8741@candle.brasslantern.com>, "Bart Schaefer" writes: > This is a side-effect of ksh array compatibility, believe it or not. Hm. > So, given the choices > (1) leave it as is > (2) treat [n,0] as [n,-1] > (3) treat [n,0] as an error > my own preference is for (1). I encount this problem with the code such as: region="$buffer[pos1,pos2]" I represent a region by pos1 and pos2. To represent null region, I assign pos2 to pos1 - 1. I think it's natural, but it's not works when pos1 is 1. So, my preference is "treat [n,0] as null string if 0 < n". However, it is no ploblem with the code such as: local tmp=" $buffer" region="$tmp[pos1 + 1, pos2 + 1]" But, I think it's ugly. Is there exists a more smart code? # For example, is it representable with only variable expansion? -- Tanaka Akira