From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24886 invoked by alias); 24 Sep 2014 14:07:43 -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: 33226 Received: (qmail 28966 invoked from network); 24 Sep 2014 14:07:42 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=M2RxQ69yb9fg/mEm8vSWaNU8+sBnlAu/T7IqI2Ro3ZE=; b=DGw7AxkaLyZcJvPsPbcSyytkpt5EcGeEQrRWjGEMZ4SsIjlbC27WPrnP8BixCg+hGB P2Q1/+xmLYbRw1yv/m7dBKVfQzq1R7giylOv2687dLM9CaruEBEbpMLtkcBTLl0bl1aV hgpyv7Zv2P8sXjti6LfC9zraMh67jNPU/S6gChMU/5Zqv1Y7uMzrUU5fHwYB4Yo9VbpT Q1sQdI1aLMXhdsJhIFWVI1QLV/vi2NTP7QTuIxGxUM+OXF0SFVd45qX6yQdezurniWix CtkilNaRpoRypL9OwrgXlFQELQgmk2LdiNm/rnCM0voaBDUJRrs089drXb33xN2dkjQv r20g== MIME-Version: 1.0 X-Received: by 10.50.87.99 with SMTP id w3mr13365100igz.4.1411567656949; Wed, 24 Sep 2014 07:07:36 -0700 (PDT) Date: Wed, 24 Sep 2014 16:07:36 +0200 Message-ID: Subject: Surprising parsing result with anonymous functions and for loops From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 The intended command was something along these lines: () { for a { echo $a } } some words here but I forgot the enclosing { } and wrote the following () for a { echo $a } some words here surely this doesn't work, right?... wrong: % () for a { echo $a } some words here some words here Perhaps even more surprising is the following: % () for a { echo $a } ls ls --color=auto -T 0 -A -v --quoting-style=shell I haven't looked at the parsing for the anonymous function stuff, but if it's not too hairy to fix, my vote is we drop this easter egg at some point. -- Mikael Magnusson