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

Re: alternative method for a simple for



On Tuesday 15 September 2009 14:03:54 Peter Stephenson wrote:
> On Tue, 15 Sep 2009 13:33:18 +0200
> 
> Sebastian Stark <seb-zsh@xxxxxxxxxxx> wrote:
> > ALTERNATE FORMS FOR COMPLEX COMMANDS
> >         Many of zshâs complex commands have alternate forms.  These
> > particular versions of complex commands should  be  conâ
> >         sidered  deprecated  and  may  be  removed  in the future.
> > The versions in the previous section should be preferred
> >         instead.
> 
> This has understandably caused quite a lot of confusion.  There are
>  good reasons to avoid using the alternative forms, but actually there
>  are no plans to take them out and haven't been since I took over
>  almost ten years ago now(!)  It's probably better to change this,
>  though I'd certainly like people to think before using the
>  non-standard forms.
> 
> Index: Doc/Zsh/grammar.yo
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Doc/Zsh/grammar.yo,v
> retrieving revision 1.16
> diff -u -r1.16 grammar.yo
> --- Doc/Zsh/grammar.yo	10 Jun 2008 08:50:43 -0000	1.16
> +++ Doc/Zsh/grammar.yo	15 Sep 2009 11:54:40 -0000
> @@ -366,10 +366,10 @@
>  sect(Alternate Forms For Complex Commands)
>  cindex(alternate forms for complex commands)
>  cindex(commands, alternate forms for complex)
> -Many of zsh's complex commands have alternate forms.  These particular
> -versions of complex commands should be considered deprecated and may
>  be -removed in the future.  The versions in the previous section
>  should be -preferred instead.
> +Many of zsh's complex commands have alternate forms.  These are
> +non-standard and are likely not to be obvious even to seasoned shell
> +programmers; they should not be used anywhere that portability is a
> +concern.
> 
>  The short versions below only work if var(sublist) is of the form
>  `tt({) var(list) tt(})' or if the tt(SHORT_LOOPS) option is set.  For
>  the tt(if),
> 

It would be nice to define the term portability in this case.

Should the syntax be considered incompatible to other shells like bash in 
the same way the builtin "whence" or modifiers like $file:r aren't sh/bash 
portable either. Or are there architectural differences if zsh is compiled 
for i386, amd64 or other systems? Using zsh in different versions or 
different systems.

Attachment: signature.asc
Description: This is a digitally signed message part.



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