Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature request: a new warning option
- X-seq: zsh-users 24333
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Re: Feature request: a new warning option
- Date: Wed, 9 Oct 2019 13:24:01 +0000
- Accept-language: en-GB, en-US
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20191009132403euoutp013c121e0fc8f7da2a27b64c39c26bebd1~L-Va1Xv993024630246euoutp01v
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1570627443; bh=Cf14tmk9lL2anyhOFHL9RgsZOq753SP3LNMkWPNg5us=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oX9HV8A2LSHuuYenAf1r3SeSwTSHmW/ziOpuNAh4d5urF4RVXjd6c/xQFQb79J6qV aSGgD7fOK9wcJ8IeF4vJ8xokEd4u2uc1MdodFJbM/A3qKEcSxOYxEXhFIAtW9dKfJ0 teMjkgHSyZaL8QFyD482hCBNS9RypnoDqk+n8slk=
- In-reply-to: <CAKc7PVA+Ch+XqDj4aZRErr28Qo+0sejvt-d7F7m09YooC9psUg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVDN-GspoiS-iVR5ThdbDVbLWVNJWcZ=TyY0=9ydtPswAw@mail.gmail.com> <CAN=4vMraXtTooeYfBDGObA7xVhoC6JpHRz1C3CUHKiW=LY8Nuw@mail.gmail.com> <CAKc7PVChNY2jjRW2TSw0c=V6yXv+5cp1OsgikihLv0iUi2+h=g@mail.gmail.com> <CAN=4vMq9uM_myMu55xjZ-+483JUY+VnmeEd4kCpOqBc8SurwFg@mail.gmail.com> <CGME20191009131852epcas2p368527332310d5197425b853f2a78e07d@epcas2p3.samsung.com> <CAKc7PVA+Ch+XqDj4aZRErr28Qo+0sejvt-d7F7m09YooC9psUg@mail.gmail.com>
- Thread-index: AQHVflbBT2vLbMd/1k2CryCk1XKeGqdR7kyAgAA1bQCAAANHAIAAE1oAgAAB1YA=
- Thread-topic: Feature request: a new warning option
On Wed, 2019-10-09 at 15:17 +0200, Sebastian Gniazdowski wrote:
> On Wed, 9 Oct 2019 at 14:08, Roman Perepelitsa
> <roman.perepelitsa@xxxxxxxxx> wrote:
> >
> >
> > Warns if `x && y || z` cannot be proven through static analysis to
> > be equivalent to `if x; then y; else z; fi`.
> >
> > Doesn't this strike you as odd? If the latter construct has the
> > desired semantics, why not use it in the first place? It'll obviate
> > the need for a new warning and convey the intention to humans reading
> > the code.
>
> The x && y || z is less verbose. It doesn't require `then' and `else'
> and `fi'. I'm writing from my point of view – that are the reasons why
> I use &&/||.
Hmm... that's fair enough, but if you're happy to trade off against
readability I think you have to take possible difficulties with the
syntax on the chin...
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author