Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: string range between 1 and 0.
- X-seq: zsh-workers 7207
- From: Wayne Davison <wayne@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: string range between 1 and 0.
- Date: Mon, 19 Jul 1999 12:10:56 -0700 (PDT)
- Cc: Tanaka Akira <akr@xxxxxxxxxxx>, zsh-workers@xxxxxxxxxxxxxx
- In-reply-to: <990719050457.ZM8827@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author