Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Surprising parsing result with anonymous functions and for loops
- X-seq: zsh-workers 33226
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Surprising parsing result with anonymous functions and for loops
- Date: Wed, 24 Sep 2014 16:07:36 +0200
- 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==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author