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

Re: PATCH Re: let unset array element remove compatible with bash



On Sat, 07 Jul 2012 10:02:03 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jul 2, 10:11am, Peter Stephenson wrote:
> }
> } Hmm... I'd have said putting in an empty element in was the least
> } surprising thing to do, at least in the short term.  I don't think
> } shifting an array so that the numbering is different mimics the ability
> } to have only certain elements set to any great degree, there are too
> } many other cases.
> 
> OK, here's one more patch for this, which replaces both 30552 and 30557.
> 
> Note that unsetting a slice of a scalar still deletes the slice, but it
> might in fact be possible to poke a Nularg in there instead and really
> have a 4-character string with a length of 5.  On the other hand, it
> does not do sensible things to put a string-consisting-of-Nularg into
> an unset array element, because this causes the empty element to be
> retained when expanding ${array[*]} whereas the desired effect is to
> have an unset element disappear.

Thanks, shall we go with what you've got for now and think about extensions
later?

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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