zsh-users
 help / color / mirror / code / Atom feed
From: rahul <rahul2012@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-users@zsh.org
Subject: Re: array prepend
Date: Tue, 15 Jan 2013 00:18:11 +0530	[thread overview]
Message-ID: <CACQNQ9MJ6_steMFsvqAWnqtYS4f3eRC2dOb_agyxqbqScyVwgA@mail.gmail.com> (raw)
In-Reply-To: <130114073236.ZM6828@torch.brasslantern.com>

[-- Attachment #1: Type: text/plain, Size: 960 bytes --]

On Mon, Jan 14, 2013 at 9:02 PM, Bart Schaefer <schaefer@brasslantern.com>wrote:

> On Jan 14, 10:18am, rahul wrote:
> }
> } I was wondering what the way for inserting into an array is. Is the
> } following the simplest or most direct way:
> }
> }     $FOO[1,2] xxx $FOO[3,-1]
>
> Probably
>
>         FOO[N]+=(xxx)
>
> Note this is distinct from
>
>         FOO[N]+=xxx
>
> which will string-append xxx to the value stored at $FOO[N].
>

Wow! I was not going to ask this, since i have been asking too many
questions, but after reading your reply I can't resist asking this.

I was hoping to assign lists (arrays) to an associative array, and got the
error which is well documented on the internet. But no one has given any
workaround or alternative to this.

   FOO[a]=("a command" "some text" "etc etc")

zsh: FOO: attempt to set slice of associative array

Is the only alternative to do the following:

FOO_a=( a list)
FOO_b=(another list)

-- 
thx,  rahul

  reply	other threads:[~2013-01-14 18:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11  6:58 sergio
2013-01-12  1:38 ` Oliver Kiddle
2013-01-13 18:51   ` Peter Stephenson
2013-01-14  4:48     ` rahul
2013-01-14 15:32       ` Bart Schaefer
2013-01-14 18:48         ` rahul [this message]
2013-01-17  4:34           ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACQNQ9MJ6_steMFsvqAWnqtYS4f3eRC2dOb_agyxqbqScyVwgA@mail.gmail.com \
    --to=rahul2012@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).