From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5110 invoked by alias); 25 Jun 2015 15:17:07 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35603 Received: (qmail 26231 invoked from network); 25 Jun 2015 15:17:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=glaPNt65c3uJHOTXzt82PURwij4NLcd+eqwfbeTdTQ8=; b=fE3wJgT8qO1QGAYd9uZkxN2UtMF06Eq1kR/p3IHQ05nqP4WE/lbo4vYtIKYqxxyM+H +jXipi4EeCgzOxZyRJqZV5voz8rxZ6X84z8vSdXiBcjjwsBK/7WGsJJtL8V8ztfDsIrx BxIgnAqGwi9eekJZrSuJhs0EXcTiBskTbd2FU1uIn3UFphwx2jyKRoNnC8gGh2rEjRsH m/cllPlwmw8vF5gEzgHHkW8gqUqelFMeObh6TmQXL2m/Jbupy7AIVCiDmwWSKK/9V5ca vPcIc12IL5O/4sOMX5bQ4ZQike79+fIYFS5qVBGUhFCv3CGeQHoQxyyX/XJznRL45DAl fDrQ== X-Gm-Message-State: ALoCoQn2yOwVGkSRp1tpImlZ1n1Kfl2KZLeRfwFGwLDP3bnMdTEbERb5XGVciVkn5YZmBdEoqaMw X-Received: by 10.202.45.23 with SMTP id t23mr37838875oit.110.1435245422681; Thu, 25 Jun 2015 08:17:02 -0700 (PDT) From: Bart Schaefer Message-Id: <150625081653.ZM20153@torch.brasslantern.com> Date: Thu, 25 Jun 2015 08:16:53 -0700 In-Reply-To: <20150625102923.1dc227ff@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: Typeset with array" (Jun 25, 10:29am) References: <5578996E.3080700@thequod.de> <150610191427.ZM30841@torch.brasslantern.com> <5579C247.1060800@thequod.de> <150611183639.ZM32247@torch.brasslantern.com> <20150612094237.338f79d5@pwslap01u.europe.root.pri> <20150619123930.2688d9e3@pwslap01u.europe.root.pri> <7337.1434735386@thecus.kiddle.eu> <20150625102923.1dc227ff@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Zsh Hackers' List" Subject: Re: Typeset with array MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 25, 10:29am, Peter Stephenson wrote: } } > Bash allows array element assignments: } > typeset var[4]=hello } > Zsh now prints "can't create local array elements" } > Including when not in a function. } } The problem isn't the assignment but you haven't yet told the shell that } "var" is a (local?) variable or what type it is. Some quick tests: torch% typeset var var[2]=two torch% typeset -p var typeset var=two torch% typeset -a array array[2]=two typeset: array[2]: inconsistent type for assignment torch% typeset -p array typeset -a array array=() torch% typeset newarray=() newarray[2]=two zsh: segmentation fault (core dumped) Src/zsh -f #0 0x080bce65 in prefork (list=0x0, flags=2) at ../../zsh-5.0/Src/subst.c:58 #1 0x0806ab0f in execcmd (state=0xbff08f60, input=0, output=0, how=18, last1=2) at ../../zsh-5.0/Src/exec.c:3586 #2 0x08065b69 in execpline2 (state=0xbff08f60, pcode=131, how=18, input=0, output=0, last1=0) at ../../zsh-5.0/Src/exec.c:1718 #3 0x08064f08 in execpline (state=0xbff08f60, slcode=9218, how=18, last1=0) at ../../zsh-5.0/Src/exec.c:1501 #4 0x080647a8 in execlist (state=0xbff08f60, dont_change_job=0, exiting=0) at ../../zsh-5.0/Src/exec.c:1277 #5 0x0806418e in execode (p=0xb7d68798, dont_change_job=0, exiting=0, context=0x8149bb3 "toplevel") at ../../zsh-5.0/Src/exec.c:1074 #6 0x08080819 in loop (toplevel=1, justonce=0) at ../../zsh-5.0/Src/init.c:207 #7 0x08083c48 in zsh_main (argc=2, argv=0xbff090b4) at ../../zsh-5.0/Src/init.c:1675 #8 0x0804c2ea in main (argc=2, argv=0xbff090b4) at ../../zsh-5.0/Src/main.c:93