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

Re: [PATCH] Use == in expressions instead of the deprecated =



On Thu, 08 Sep 2016 15:31:28 +0100
Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> 2016-09-08 12:16:28 +0100, Peter Stephenson:
> [...]
> > diff --git a/Doc/Zsh/cond.yo b/Doc/Zsh/cond.yo
> > index 3d369fb..6fcf3bd 100644
> > --- a/Doc/Zsh/cond.yo
> > +++ b/Doc/Zsh/cond.yo
> > @@ -103,8 +103,8 @@ true if var(file1) and var(file2) exist and refer to the same file.
> >  xitem(var(string) tt(=) var(pattern))
> >  item(var(string) tt(==) var(pattern))(
> >  true if var(string) matches var(pattern).
> > -The `tt(==)' form is the preferred one.  The `tt(=)' form is for
> > -backward compatibility and should be considered obsolete.
> > +The `tt(==)' form is the preferred one for clarity in new shell code
> > +as it more closely resembles other languages.
> [...]
> 
> ksh93 also makes "==" obsolete in [[...]]. "==" is still not
> POSIX (and likely not going to be soon as requests to add it
> have been rejected (IIRC)) for the "test"/"[" utility (or expr).

So possibly even saying == is preferred is going a bit far, though
obviously there's no reason ever to remove it...

pws



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