From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16709 invoked by alias); 9 Sep 2016 09:04:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39251 Received: (qmail 19454 invoked from network); 9 Sep 2016 09:04:30 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f49.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.82.49):SA:0(0.0/5.0):. Processed in 1.185649 secs); 09 Sep 2016 09:04:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: stephane.chazelas@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.82.49 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=04iLO4y91R2PCRxKa4eBHKrBGvvxeyh1oF4hmgiRfmU=; b=bI1DBsyWCmkxzfcpXmc21iPZqeF+WJrD4pdx7JswKEPjf5nzBUVkqukavpwNDi9qSs I4pbxwelKsuzXvMUBfGYRLRnQIjB22R0QfjWI85B4XokDKNRlXtWnXKg9KXOgju3kH5L ZWMp/VwiaiyreCZVQKscXgi9zUB4FOPDHXNDTpLnKNgjABkXQL/0qrl2kEMdExxjbNUi /cBSCnS3l/k9YUVKH4WihirJvzyqPA2g1VPSjwq/a1Yur3gNNfQi6W4Lk57P1Pt7Ih+q XKuZYoNCLq3Xb5Q6fiweqvaKsSgmc6Zgf2KNYzRJuMsP7SGEy2bd5nGYM95DQySj9Kxp xVNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=04iLO4y91R2PCRxKa4eBHKrBGvvxeyh1oF4hmgiRfmU=; b=PINT2Btd/0MmOgiUDXH7bIc7SpkrN5/hSMUf112QUjRVeB02WZT9reXX5JotMcNdm8 9Odf1sdlcYx8KiTw+YSDc9V00bXDx41RMyLoqERAVGfzouvPy3qwllAEyQ4h5MbmFujs nYpEr9hO4y/m04R7DZ6vFb165ejYO1Wu0HGBiq/gwGID7DX+p3ksLNzxfd95Vzf1R2Mg /jp9l+a1X9lG0kU6Ek5vsMqtybwYrdvtnkozTtYJI/jMzYl1z+HmckXJouOuyWh1s8Gv gC4925cZ6ejmOArMsBnYHGFUdQyUfBwveokuFCi4YhEPicDVqbOPXuRqFpsstNv1+ORT 3oXw== X-Gm-Message-State: AE9vXwM4XVr55dI8o7c6jFjd+A3dtb98FG+kqTU15uglK82905dFWykFDYT6pHRhZs6S2g== X-Received: by 10.28.12.209 with SMTP id 200mr9130399wmm.118.1473345090819; Thu, 08 Sep 2016 07:31:30 -0700 (PDT) Date: Thu, 8 Sep 2016 15:31:28 +0100 From: Stephane Chazelas To: Peter Stephenson Cc: zsh-workers@zsh.org Subject: Re: [PATCH] Use == in expressions instead of the deprecated = Message-ID: <20160908143128.GA14933@chaz.gmail.com> Mail-Followup-To: Peter Stephenson , zsh-workers@zsh.org References: <20160905212754.24998-1-tgyurci@gmail.com> <20160908093516.4fc2dd1e@pwslap01u.europe.root.pri> <20160908121628.78977edd@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160908121628.78977edd@pwslap01u.europe.root.pri> User-Agent: Mutt/1.5.21 (2010-09-15) 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). I suspect the reason David Korn obsoleted "==" is mainly for consistency with the ((...)) "==" operator. There, "==" is comparison and "=" is assignment like in C/awk (and other languages that don't do the disambiguation via some other mean like :=/= or <-/=). However inside [[...]], there is no possible confusion between assignment and comparison as [[...]] is only a construct for doing tests, so no point in having a "==" there. I personally use "=" (even for [[...]]), as that's what's standard for "test"/"[". The risk with stating that "==" is obsolete is that people are going to start using [ "$a" == "$b" ] (as many do already) thinking it's the right thing to do and get bitten when "sh" changes from bash/zsh/ksh/yash to another sh implementation whose "test" builtin doesn't support "==" -- Stephane