Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zero- vs one- based array indexing?



Greg Klanderman wrote:
> Can someone give me a quick history of why zsh defaults to one-based
> array indexing?  Bash and ksh appear to use zero-based indexing, and
> probably most CS types prefer that too.

Basically from csh, I think.  Arrays were a bit of an afterthought in
earlier Bourne-style shells, so zsh didn't take much notice.

> Would it be OK to add an
> option to control just zero-based arrays separately from the other
> changes KSHARRAYS brings?

It's far too late for this.  Encouraging people to use anything other
than native zsh or ksh emulation would be a disaster, multiplying our
problems yet more and solving nothing.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author