From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1590 invoked from network); 19 Jul 1999 19:11:21 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Jul 1999 19:11:21 -0000 Received: (qmail 9729 invoked by alias); 19 Jul 1999 19:11:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7207 Received: (qmail 9721 invoked from network); 19 Jul 1999 19:11:08 -0000 Date: Mon, 19 Jul 1999 12:10:56 -0700 (PDT) From: Wayne Davison To: Bart Schaefer cc: Tanaka Akira , zsh-workers@sunsite.auc.dk Subject: Re: string range between 1 and 0. In-Reply-To: <990719050457.ZM8827@candle.brasslantern.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 19 Jul 1999, Bart Schaefer wrote: > The difficulty with doing this is that C arrays are indexed from 0. So > when zsh uses 1-based indices, it has to decrement them before indexing > into the internal representation of the value. This decrement is done > at parse time (unless the value is already zero), so that thereafter the > same code can be used for ksh and zsh arrays. Sounds to me like a good fix would be to change the parse code to turn ksh arrays into zsh arrays (incrementing non-negative numbers) OR to turn the values into an internal representation of offset and length at parse time (though you may have to leave -1 unchanged if you don't know the length). This way, the C code would be able to handle the more flexible indexing values properly (the zsh values) without affecting ksh compatibility. ..wayne..