zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ifh.de>
To: Bernd Eggink <eggink@rrz.uni-hamburg.de>,
	zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: Re: Treatment of illegal indices
Date: Mon, 23 Feb 1998 10:23:21 +0100	[thread overview]
Message-ID: <199802230923.KAA03818@hydra.ifh.de> (raw)
In-Reply-To: "Bernd Eggink"'s message of "Sun, 22 Feb 1998 16:07:40 MET." <34F03F3C.5FFA09E@rrz.uni-hamburg.de>

Bernd Eggink wrote:
> The way zsh treats illegal array indices is pretty ugly. It simply
> replaces indices which are 0 (with KSH_ARRAYS unset) or < -length by 1.
>
> Possible improvements could be:
> 
> c) Print an error message if an illegal index is used on the left      
> side of an assignment, return an empty value otherwise.

I think this is better; it's fairly standard for interpreted languages.
The `feature' that 0 is treated as 1 has been around for a long time,
but since KSH_ARRAYS it's probably time it went.  You are supposed to
be able to extend arrays by assignment, remember:  some time ago there
was an argument about whether

23456789=''

using up a lot of memory was a bug, and it was decided it wasn't.

-- 
Peter Stephenson <pws@ifh.de>       Tel: +39 50 911239
WWW:  http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy


  parent reply	other threads:[~1998-02-23  9:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-22 15:07 Bernd Eggink
1998-02-22 18:11 ` Bart Schaefer
1998-02-23  9:23 ` Peter Stephenson [this message]
1998-02-23  9:25 ` Andrew Main
1998-02-23 10:22   ` Peter Stephenson
1998-02-25 12:13 ` Bernd Eggink
1998-02-25 12:33   ` Andrew Main
1998-02-25 14:02     ` Bernd Eggink
1998-02-25 14:11       ` Andrew Main

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199802230923.KAA03818@hydra.ifh.de \
    --to=pws@ifh.de \
    --cc=eggink@rrz.uni-hamburg.de \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).