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

Re: Shell variable tables:setting value for elemet 1 overwrites element 0



On May 25,  1:05pm, Peter Stephenson wrote:
} Subject: Re: Shell variable tables:setting value for elemet 1 overwrites e
}
} wojciech.szenajch@xxxxxxxxxxx wrote:
} > If this is the case, then any operation performed on element 0 should
} > return error message. This is misleading that operations like
} > TB[0]=zero; echo ${TB[0]} are accepted.
} 
} Yes, it was probably the wrong decision to accept [0] in this case.
} I hope no one's relying on it, but you can't be sure.

I don't think there's any reason to allow *assignment* to index zero,
except perhaps as a way to accomplish array=(newelement $array).  The
dereference of $array[0] is a different matter.



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