zsh-users
 help / color / mirror / code / Atom feed
* Complex forms deprecated?
@ 2007-06-11 14:40 antho.charles
  2007-06-11 15:15 ` Peter Stephenson
  2007-06-13  8:31 ` Marc Chantreux
  0 siblings, 2 replies; 11+ messages in thread
From: antho.charles @ 2007-06-11 14:40 UTC (permalink / raw)
  To: zsh-users

Hi everyone,

I would like to know if the alternate forms for complex commands
(cf. zshmisc) are really deprecated as mentionned, and if they are
really supposed to be removed some day.

Please don't bother to correct my english.

Thanks in advance

-- 
Anthony CHARLES


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

* Re: Complex forms deprecated?
  2007-06-11 14:40 Complex forms deprecated? antho.charles
@ 2007-06-11 15:15 ` Peter Stephenson
  2007-06-13  8:31 ` Marc Chantreux
  1 sibling, 0 replies; 11+ messages in thread
From: Peter Stephenson @ 2007-06-11 15:15 UTC (permalink / raw)
  To: zsh-users

antho.charles@gmail.com wrote:
> I would like to know if the alternate forms for complex commands
> (cf. zshmisc) are really deprecated as mentionned, and if they are
> really supposed to be removed some day.

There are no plans to remove them; there's very little to gain.
Anything that clashes with standard syntax is (so far as I know)
already covered by an option.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview


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

* Re: Complex forms deprecated?
  2007-06-11 14:40 Complex forms deprecated? antho.charles
  2007-06-11 15:15 ` Peter Stephenson
@ 2007-06-13  8:31 ` Marc Chantreux
  2007-06-13 13:42   ` antho.charles
                     ` (2 more replies)
  1 sibling, 3 replies; 11+ messages in thread
From: Marc Chantreux @ 2007-06-13  8:31 UTC (permalink / raw)
  To: zsh-users


> I would like to know if the alternate forms for complex commands
> (cf. zshmisc) are really deprecated as mentionned, and if they are
> really supposed to be removed some day.

Deprecated ? but why ? i always thought that the stoneage syntax will be 
deprecated some day!

I think that modern syntax is a simple feature that makes zsh faster to 
  use than any other shell. coming from bash, i was very impressed to write

for f ( *.jpg ) mv $f $f:r.jpeg

instead of

for f in *.jpg; do mv $f $f:r.jpeg; done

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


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

* Re: Complex forms deprecated?
  2007-06-13  8:31 ` Marc Chantreux
@ 2007-06-13 13:42   ` antho.charles
  2007-06-13 15:11     ` Matt Wozniski
  2007-06-13 15:42   ` Bart Schaefer
  2007-06-16 14:44   ` Thomas Köhler
  2 siblings, 1 reply; 11+ messages in thread
From: antho.charles @ 2007-06-13 13:42 UTC (permalink / raw)
  To: zsh-users

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


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

* Re: Complex forms deprecated?
  2007-06-13 13:42   ` antho.charles
@ 2007-06-13 15:11     ` Matt Wozniski
  2007-06-13 15:27       ` Marc Chantreux
  2007-06-13 16:28       ` Bart Schaefer
  0 siblings, 2 replies; 11+ messages in thread
From: Matt Wozniski @ 2007-06-13 15:11 UTC (permalink / raw)
  To: zsh-users; +Cc: antho.charles

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@gmail.com <antho.charles@gmail.com> 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
>


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

* Re: Complex forms deprecated?
  2007-06-13 15:11     ` Matt Wozniski
@ 2007-06-13 15:27       ` Marc Chantreux
  2007-06-13 15:50         ` Frank Terbeck
  2007-06-13 16:28       ` Bart Schaefer
  1 sibling, 1 reply; 11+ messages in thread
From: Marc Chantreux @ 2007-06-13 15:27 UTC (permalink / raw)
  To: zsh-users

Matt Wozniski wrote:
> standard syntax that will work in bash, ksh, zsh, sh, dash, ash,
> etc...  

i also often use nested variable expansions, extendedglobs, and other 
zsh only features: as zsh is far better than other shells, i don't carre 
about compatibility!

So i use alternative zsh syntax and Darwin will do the rest ;)

> 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.

yet another syntax ... but lot of us have braces habbits (from C, java, 
javascript, perl, ...)

> the alternate syntax would make for shell scripts that look a
> horrifying amount like csh scripts.. *shudder*

sure ... but stone age syntax remind me pascal ;)

> 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)

is there a good reason to depreciate?

> than set you back as a shell programmer by making you learn an awkward
> syntax that isn't at all portable.

have you tried the alternative syntax? it feels more natural to me to 
write code with this one so i think that never had to learn it.

I understand your point of view and you're free to use stone age syntax 
  but i just think that the modern syntax would *not* be deprecated.

regards
marc


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

* Re: Complex forms deprecated?
  2007-06-13  8:31 ` Marc Chantreux
  2007-06-13 13:42   ` antho.charles
@ 2007-06-13 15:42   ` Bart Schaefer
  2007-06-16 14:44   ` Thomas Köhler
  2 siblings, 0 replies; 11+ messages in thread
From: Bart Schaefer @ 2007-06-13 15:42 UTC (permalink / raw)
  To: zsh-users

On Jun 13, 10:31am, Marc Chantreux wrote:
} 
} > I would like to know if the alternate forms for complex commands
} > (cf. zshmisc) are really deprecated as mentionned, and if they are
} > really supposed to be removed some day.
} 
} Deprecated ? but why ? i always thought that the stoneage syntax will be 
} deprecated some day!

As is often the case, the answer to "why?" is a history lesson.

Back in the dawn of time (that would be around 1990), zsh was created
to be a shell that had all the interactive advantages of csh and all
the scripting advantages of the Bourne shell.  It therefore had a mix
of the syntax of both, but made no special effort to be 100% compatible
with either of them.

Skip ahead a few years.  Paul Falstad is no longer at Princeton [1] and
no longer has an active role in maintaining zsh.  At the same time, the
POSIX standard has begun to be widely accepted and the Korn shell is
spreading through the commercially-available UNIX platforms.  Both of
these enshrine the "stoneage" Bourne shell syntax as The Standard, with
a smaller number of extensions but some that zsh doesn't have. [2]

In this context, the group that had taken over zsh from Paul decided [3]
that the thing to do was to abandon the "obsolete" csh syntax and become
a Korn shell clone.  Options that had been named "csh_whatever" became
"csh_junkie_whatever" [4] and "glob_qual" became "bare_glob_qual" and
so on.  The manual was reoganized to separate the non-POSIXy syntax into
its own section and parts were marked as deprecated.  Other assorted
changes were begun that would eventually lead to the "emulate" command
and to POSIX compatibility when running as "sh". [5]

Skip ahead another few years.  Now Linux is beginning to explode and
has carried zsh with it into parts of the world it never saw before.
The leadership of the Zsh Development Group has changed from mostly
American college students and sysadmins to mostly European university
students and computer professionals.  The faction that was strongly
in favor of becoming a pure POSIX shell has moved on, and the major
development focus has shifted from shell syntax to the new completion
system and the dynamic module architecture.

This environment made the things that were different about zsh into
strengths rather than perceived weaknesses. [6]  The larger user base
made backward compatibility more important. [7]  Most zsh development
had been in the C code before, but now the biggest project was being
written in the shell language itself, and there wasn't any incentive
to keep fooling with the parser.  The plans to drop the "deprecated"
features evaporated, but there didn't seem to be any reason to update
the manual to restore them to their former status.

Which, after another skip of a few years, brings us to the present,
where the shell has mostly stabilized, the development group is led
almost entirely by computer professionals, [8] the focus is on
cleaning up the messes left by the previous 15 years, and it requires
500 words to answer a one-word question. [9]


[1] In fact, he was working for me at Z-Code Software.
[2] And in some cases still doesn't have, in large part because of
    internal code structure from the original implementation that
    doesn't lend itself to the ksh extension style.
[3] I objected to this decision.
[4] Only "addicts" would insist on using csh syntax, you see.
[5] So it wasn't all bad.
[6] From my admittedly subjective viewpoint, see [3].
[7] You can make people reconfigure their MP3 player every time you
    upgrade it, but if you meddle with their shell they can't even
    log in.
[8] We need to get a few more students in here again, but they're
    all off programming in Java and Python.
[9] Somebody should add all this to the Zsh entry on Wikipedia.


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

* Re: Complex forms deprecated?
  2007-06-13 15:27       ` Marc Chantreux
@ 2007-06-13 15:50         ` Frank Terbeck
  2007-06-13 16:28           ` Joel J. Adamson
  0 siblings, 1 reply; 11+ messages in thread
From: Frank Terbeck @ 2007-06-13 15:50 UTC (permalink / raw)
  To: zsh-users

Marc Chantreux <marc.chantreux@ulpmm.u-strasbg.fr>:
[...]
> I understand your point of view and you're free to use stone age syntax  
> but i just think that the modern syntax would *not* be deprecated.

Just as a side-note: I don't know if syntaxes using braces in
programming languages is a newer concept then closing keywords, but
calling one 'stone-age' and the other 'modern' seems just wrong.

Not that my opinion matters much, but: zsh still is a bourne like
shell. And I don't blame its loop constructs to look like that. I even
appreciate it. Why make it look like Perl, C or Java? Readability?
I think not. I never used alternate forms of loops in anything more
than playing around, and I never felt like using zsh in an
unfashioned/obsolete way. Personally, I agree with Matt, the alternate
forms remind me of csh, which is a strong reason not to use them (for
me), and if it's just to avoid the bad taste in my mouth. :-)

Yet, I a happy zsh _does_ have these alternate forms, so people may
use them if they want to. Just calling the standard forms in ways as
if their use should be deprecated instead is wrong, IMHO. That fealing
also triggered this mail. :-)

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


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

* Re: Complex forms deprecated?
  2007-06-13 15:11     ` Matt Wozniski
  2007-06-13 15:27       ` Marc Chantreux
@ 2007-06-13 16:28       ` Bart Schaefer
  1 sibling, 0 replies; 11+ messages in thread
From: Bart Schaefer @ 2007-06-13 16:28 UTC (permalink / raw)
  To: zsh-users

On Jun 13, 11:11am, Matt Wozniski wrote:
}
} Not to mention that, to me at least, the rules about what can be used
} as the delimiter where are kinda fuzzy.

They're not fuzzy if you really understand the shell grammar.  Confusing,
maybe, but not 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...

Braces denote blocks that are executed in the current shell.  Parens
denote blocks that are executed in a forked subshell.  The body of the
if statement has to be a current shell construct, and the conditions
of the if statement have to form a list [in the shell grammar sense
of "list"] of valid shell commands.  The first two both work because
both {true} and (true) are valid shell commands; the last does not
work because (echo good) is not a current shell construct and two
subshells in a row is not a valid list.

Even that is a paraphrase; the deeper reason has to do with "{" being
a "reserved word" in the grammar whereas "(" is merely a token, but it's
easier to follow the reasoning if you think about current vs. subshell.


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

* Re: Complex forms deprecated?
  2007-06-13 15:50         ` Frank Terbeck
@ 2007-06-13 16:28           ` Joel J. Adamson
  0 siblings, 0 replies; 11+ messages in thread
From: Joel J. Adamson @ 2007-06-13 16:28 UTC (permalink / raw)
  To: zsh-users

Frank Terbeck <ft@bewatermyfriend.org> writes:

> Marc Chantreux <marc.chantreux@ulpmm.u-strasbg.fr>:
> [...]
>> I understand your point of view and you're free to use stone age syntax  
>> but i just think that the modern syntax would *not* be deprecated.
>
> Just as a side-note: I don't know if syntaxes using braces in
> programming languages is a newer concept then closing keywords, but
> calling one 'stone-age' and the other 'modern' seems just wrong.

Good point, particularly when using a mouse is considered modern in
many circles.  I consider it positively _stone_-_age_ since it is an
extension of one's hand, whereas using a keyboard is a decidedly
19th-century activity ;)

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109





The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.


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

* Re: Complex forms deprecated?
  2007-06-13  8:31 ` Marc Chantreux
  2007-06-13 13:42   ` antho.charles
  2007-06-13 15:42   ` Bart Schaefer
@ 2007-06-16 14:44   ` Thomas Köhler
  2 siblings, 0 replies; 11+ messages in thread
From: Thomas Köhler @ 2007-06-16 14:44 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

Marc Chantreux wrote:
[...]
> I think that modern syntax is a simple feature that makes zsh faster to 
>  use than any other shell. coming from bash, i was very impressed to write
> 
> for f ( *.jpg ) mv $f $f:r.jpeg
> 
> instead of
> 
> for f in *.jpg; do mv $f $f:r.jpeg; done

I prefer
for f in *.jpg ; mv $f $f:r.jpeg
:-)

> 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

For me, there is a simple reason to prefer
   if cmd ; then foo ; else bar ; fi
over
   if ( cmd ) { foo } else { bar }

On German keyboard layout, "{" and "}" are notoriously bad to
type (using Alt-gr (=right alt) and 7/0 from the upper keyboard
row) [which is one of the reasons why I mapped "if" to become
   if (_) {
   }
(cursor on "_") in vim for perl hacking...].
Using ";" and "normal" words is not so strange to type...

Ciao,
Thomas

-- 
 Thomas Köhler       Email:       jean-luc@picard.franken.de
     <><             WWW:              http://gott-gehabt.de
                     IRC:                           tkoehler
                     PGP public key available from Homepage!

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2007-06-17  3:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-11 14:40 Complex forms deprecated? antho.charles
2007-06-11 15:15 ` Peter Stephenson
2007-06-13  8:31 ` Marc Chantreux
2007-06-13 13:42   ` antho.charles
2007-06-13 15:11     ` Matt Wozniski
2007-06-13 15:27       ` Marc Chantreux
2007-06-13 15:50         ` Frank Terbeck
2007-06-13 16:28           ` Joel J. Adamson
2007-06-13 16:28       ` Bart Schaefer
2007-06-13 15:42   ` Bart Schaefer
2007-06-16 14:44   ` Thomas Köhler

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).