zsh-workers
 help / color / mirror / code / Atom feed
* zero- vs one- based array indexing?
@ 2009-09-23 16:50 Greg Klanderman
  2009-09-23 17:03 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Klanderman @ 2009-09-23 16:50 UTC (permalink / raw)
  To: Zsh list


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.  Would it be OK to add an
option to control just zero-based arrays separately from the other
changes KSHARRAYS brings?

thanks,
Greg


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: zero- vs one- based array indexing?
  2009-09-23 16:50 zero- vs one- based array indexing? Greg Klanderman
@ 2009-09-23 17:03 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2009-09-23 17:03 UTC (permalink / raw)
  To: Zsh list

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@csr.com>            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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-23 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-23 16:50 zero- vs one- based array indexing? Greg Klanderman
2009-09-23 17:03 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).