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

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



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.



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