Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Complex forms deprecated?

In my humble opinion, they ought to be deprecated.  That is to say, I
would have no problem with their deletion should the time ever come
when they require maintenance or some such.

I see no reason to ever use the alternative syntax:
for f ( *.jpg ) { mv $f $f:r.jpeg }<ENTER>

over the syntax offered by the shortloops option:
for f in *.jpg<ENTER>
for> mv $f $f:r.jpeg<ENTER>

Granted, the alternative syntax is slightly fewer characters if you
intend to have multiple lines after the 'for' and can't use shortloops
to do what you want, but even so I think you should just use the
standard syntax that will work in bash, ksh, zsh, sh, dash, ash,
etc...  The advantage to learning with shortloops is that it lets you
learn the "quick way" provided by zsh, and the "standard way" for when
the quick way doesn't do the job you need the way you want it done.
Introducing a third, completely unrelated syntax just makes the job of
the shell user harder when they have to use a different shell and
can't remember how loops work in plain ol' sh.  Not to mention that
the alternate syntax would make for shell scripts that look a
horrifying amount like csh scripts.. *shudder*

Not to mention that, to me at least, the rules about what can be used
as the delimiter where are kinda fuzzy.
For instance, both
if {true} {echo good} else {echo bad}
if (true) {echo good} else {echo bad}
work, but
if (true) (echo good) else (echo bad)
doesn't work...  There might be a reason for it that I didn't catch,
since I just skimmed the manpage, but from a quick glance, I think
that learning that alternate syntax would serve to do nothing more
than set you back as a shell programmer by making you learn an awkward
syntax that isn't at all portable.


On 6/13/07, antho.charles@xxxxxxxxx <antho.charles@xxxxxxxxx> wrote:
Thank you Peter, so I can keep using it.

On Wed, Jun 13, 2007 at 10:31:20AM +0200, Marc Chantreux wrote:
> I'm currious about how many of us are using the deprecated syntax. So
> curious that i wrote a poll page to know about it
> http://xpeerience.u-strasbg.fr:8080/cgi/zsh_syntax
> please vote!
> regards

Good idea Marc, I'd like to see if this syntax is really used, I think
it's a nice feature.

Best regards


Messages sorted by: Reverse Date, Date, Thread, Author