Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Complex forms deprecated?
- X-seq: zsh-users 11559
- From: "Matt Wozniski" <godlygeek@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Complex forms deprecated?
- Date: Wed, 13 Jun 2007 11:11:48 -0400
- Cc: "antho.charles@xxxxxxxxx" <antho.charles@xxxxxxxxx>
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=el1Ct512/BTGIJWWTmD0Ug6zEYjajrK6aszSzTf3cA/K/bjrIqOm9QUZ7v1zkLHT8JiNFNDUPjbNVsELGUg7vo30d14jKpaZ9DGCadBRPveLPYqR8Uh/wK5bxHupyEpFAftSFGH+t3twZZPxrkFBwoPKFbQ1gFPjSQfrX/Sp8aw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jS/8rs6iLKynBvHK/y54fw9ZYc8j5N82Ul/8WEkLzxTqmQAPaDyaurzfzNdgMsO5L+mFZ2PbYiow4d5K3mDWgxU+RFkg10aep9GRw27/JW9mHYwjaNTXNJBZAqAuceGcG03frI3MYGhYLRi9hPxpiKut2lBl5/CP25AjpgsXwdQ=
- In-reply-to: <20070613134247.GA13590@xxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20070611144016.GB5245@xxxxxxxxxxxxxxxxxxxxx> <466FAB58.5090103@xxxxxxxxxxxxxxxxxx> <20070613134247.GA13590@xxxxxxxxxxxxxxxxxxxxx>
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}
and
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.
~Matt
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
--
Anthony CHARLES
Messages sorted by:
Reverse Date,
Date,
Thread,
Author