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

Re: array prepend



>>>>> On January 13, 2013 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> What about a special case for empty brackets?  VAR[] is not currently
> a valid identifier even though e.g. VAR[*] is.

>  	VAR[]=(this is prepended)

So that's the same as VAR[1,0]=(...) ?  It doesn't really "look" very
much like prepend to me.

>  	VAR[]+=(this is appended)
>  	VAR+=(short for 'VAR[]+=')

Does VAR+=($x) differ at all from VAR+=$x if VAR is an array?

I was thinking of maybe '++=' for prepend, the double '+' weighting
towards the front.

Greg



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