zsh-workers
 help / color / mirror / code / Atom feed
* Surprising parsing result with anonymous functions and for loops
@ 2014-09-24 14:07 Mikael Magnusson
  2014-09-24 14:26 ` Peter Stephenson
       [not found] ` <CAKjp4B7Gy9f2RCYzn8G6i+ADh_p7GWZEv1x_Cd0eR3Ggxv+APw@mail.gmail.com>
  0 siblings, 2 replies; 11+ messages in thread
From: Mikael Magnusson @ 2014-09-24 14:07 UTC (permalink / raw)
  To: zsh workers

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-09-26  8:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-24 14:07 Surprising parsing result with anonymous functions and for loops Mikael Magnusson
2014-09-24 14:26 ` Peter Stephenson
2014-09-24 22:02   ` Mikael Magnusson
2014-09-25  5:35     ` Bart Schaefer
2014-09-25  5:53       ` Bart Schaefer
2014-09-25 10:02       ` Mikael Magnusson
2014-09-25 11:39         ` Peter Stephenson
2014-09-25 13:21           ` Mikael Magnusson
2014-09-25 13:52             ` Peter Stephenson
2014-09-26  8:58               ` Peter Stephenson
     [not found] ` <CAKjp4B7Gy9f2RCYzn8G6i+ADh_p7GWZEv1x_Cd0eR3Ggxv+APw@mail.gmail.com>
2014-09-24 19:14   ` Fwd: " Clint Hepner

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).