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

Re: Feature request: a new warning option



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 &&/||.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org



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