From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15984 invoked from network); 24 Aug 2008 20:33:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Aug 2008 20:33:28 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 93769 invoked from network); 24 Aug 2008 20:33:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Aug 2008 20:33:11 -0000 Received: (qmail 16892 invoked by alias); 24 Aug 2008 20:32:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25523 Received: (qmail 16874 invoked from network); 24 Aug 2008 20:32:55 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 24 Aug 2008 20:32:55 -0000 Received: from vms173005pub.verizon.net (vms173005pub.verizon.net [206.46.173.5]) by bifrost.dotsrc.org (Postfix) with ESMTP id 032348030846 for ; Sun, 24 Aug 2008 22:32:51 +0200 (CEST) Received: from torch.brasslantern.com ([96.238.220.178]) by vms173005.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K6400G26H1V0S91@vms173005.mailsrvcs.net> for zsh-workers@sunsite.dk; Sun, 24 Aug 2008 15:32:21 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m7OKWJBV016804 for ; Sun, 24 Aug 2008 13:32:19 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m7OKWImN016803 for zsh-workers@sunsite.dk; Sun, 24 Aug 2008 13:32:18 -0700 Date: Sun, 24 Aug 2008 13:32:18 -0700 From: Bart Schaefer Subject: Re: Weird error message when using bash or ksh form of array initialization In-reply-to: <6cd6de210808240905s40c8c86ch4766b711e87ffde5@mail.gmail.com> To: "Zsh hackers list" Message-id: <080824133218.ZM16802@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <6cd6de210808240905s40c8c86ch4766b711e87ffde5@mail.gmail.com> Comments: In reply to "Rocky Bernstein" "Weird error message when using bash or ksh form of array initialization" (Aug 24, 12:05pm) X-Virus-Scanned: ClamAV 0.92.1/8082/Sun Aug 24 18:40:03 2008 on bifrost X-Virus-Status: Clean On Aug 24, 12:05pm, Rocky Bernstein wrote: } } When I run this (erroneous?) program: } } typeset -a fd=() Zsh does not support that syntax; typeset is a command, not a keyword, so its arguments are parsed like normal shell words, not like parameter assignments. As Mikael pointed out, the above syntax defines three functions, named "typeset", "-a", and "fd=", because the shell word "()" is a token that denotes that a function name precedes it and a function body follows. Quoting it as 'fd=()' like Mikael suggested would prevent the function definition interpretation, but produces the error "can't assign initial value for array".