Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature request: a new warning option
- X-seq: zsh-users 24331
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: Feature request: a new warning option
- Date: Wed, 9 Oct 2019 14:08:12 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8S4uAvd/2p62NCHzYcRO2HSA+b594039zYMspO+TjVU=; b=Lci64KdQHlMv9AOJ76ObIyjhOlvNQ8a+LYaUbwKKKvoCxauRxQzBx/6b6lqvE776S/ St9u03GVLKgJ595/e7GauIusEQ532ndjx/LpEc1co85qoQzQ8WoYJKvE/HZHzsK57BQR FN44p8Ki6V7Lnj8zwkYRtU6b4hKJgYrnTLqfuBbWiol9GeJarEpvZ+MuZc7BQ40JjaNc OQnv4+jqyCcYXuBnd3pDPWFTSjwH4C4nYpfvYb4oD07bGaB82yHoKtTe13Qh28xMYMKZ kW8Dxbjz8ckoOuy2wCwMHzWtQUp9eztG46poVjtxpU6gMEFOSew4zCsjns08UR0PGU7o dnWw==
- In-reply-to: <CAKc7PVChNY2jjRW2TSw0c=V6yXv+5cp1OsgikihLv0iUi2+h=g@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>
On Wed, Oct 9, 2019 at 1:56 PM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
> I would say: the code that is needy of using &&/|| in such a way can
> skip this hypothetical new warning option. Covering 8 out of 10
> functions with it is still a good result (this reminds me the previous
> discussion we've had).
I'm not opposed to warnings that may have false positives. That's why
they are warnings rather than errors.
My point here is different. Imagine the documentation for the new
warning:
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.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author