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

Re: When array append without parens doesn't work?



On Tue, 18 Feb 2020 at 22:45, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
wrote:

> On Tue, Feb 18, 2020 at 10:33 PM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> >
> > Hi,
> > I recall once reporting a problem to this list, to which Bart responded
> > with "you'll thank me later" about the correct array-append syntax, which
> > is arr+=( ... ), not arr+=.... I cannot find this message.
>
> Code:
>
>   () {
>    emulate -L zsh -o ksh_arrays
>     local -a x
>     x+=a
>     x+=b
>     typeset -p x
>   }
>
> Output:
>
>   typeset -a x=( ab )
>
> Roman.
>

Thanks, however, I don't think that I was using ksharrays when I've
encountered problems with +=....
-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org


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