From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9772 invoked by alias); 25 Sep 2014 05:53:05 -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: 33239 Received: (qmail 2582 invoked from network); 25 Sep 2014 05:53:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) 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 autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=Bn3mIIpARQPumLhR/o06gCKgrVmkqEhdgSssNRPTt1I=; b=GCJTG3/5n64Lt7nodVFub6OQ7hEFl0g9iLWPbZ5sQYCkXuvGvJiqhZpLBTyM/ykgA1 xXcPdKs4ZUKK70cP6TtSFg5+IsCOYVP7wzYS3Q+ZuEYifz8zDEFWejXIFVIO4AtB/7wS cbnjgErjiL/ZnMMUClKs0Ko2jpKlx1YiWCOZr/e11HmF44+ezB4e+48MJADm9AsTKyOT kmRfqAQVsZSQ25f4zZENMWSY9LtBhQh390Ab0jCnGt3XXIUkdSarHs247Chb717eYx5l F1kJYNsSWFhfXEPcaN9JcC7YC2Hei8F7T4JiTd8wbn43K0ltk7web6KOF4vLPdPpmyRb kDsA== X-Gm-Message-State: ALoCoQm/b+cgrY7Ruy5IbuY2MAKMW4JwA9wSyfJ/btGRGKW6Ahe+/Bu3ytb0LdsRBi80gs+xoQ5V MIME-Version: 1.0 X-Received: by 10.180.10.38 with SMTP id f6mr16350964wib.30.1411624381420; Wed, 24 Sep 2014 22:53:01 -0700 (PDT) In-Reply-To: References: <20140924152625.73dfa6d9@pwslap01u.europe.root.pri> Date: Wed, 24 Sep 2014 22:53:01 -0700 Message-ID: Subject: Re: Surprising parsing result with anonymous functions and for loops From: Bart Schaefer To: zsh workers Content-Type: text/plain; charset=UTF-8 > The presence of braces around the entire body simply allows the parser > to distinguish the body from the arguments. If there are other > syntactic clues, those also distinguish body from arguments Incidentally, I think this is related to zsh's non-standard handling of redirections following a function definition. POSIX says that foo() { echo foo; } >/tmp/foo should behave the same as foo() { { echo foo; } >/tmp/foo } but in zsh it behaves like { foo() { echo foo; } } >/tmp/foo