Zsh Mailing List Archive
Messages sorted by:
Re: Feature request: a new warning option
- X-seq: zsh-users 24334
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: Feature request: a new warning option
- Date: Wed, 9 Oct 2019 15:40:48 +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:content-transfer-encoding; bh=PRxcrhV3Cvrm5a5Uq0OjE7hTAdcMBJBFDn+l5FeAqF8=; b=c2SCJ+swgH2SHMht7dB/FtuC/5VU1JcDyW7nF9EEI5w7kUAXZnKyy7YkCzQXYus9NB cAjLJZMXTjsqPGkdR2TGRmFN6tvsepc6XUQBfZ/FUqrY35gmQIt//kagsQW77y1TFV6P 1c2XTfSjWr5vwYOxoycd2Bzkh7WgkT/7qEO48M+7qry2kQBT5+eTXe3b/Sow+1nHbUZ3 p+5etZo9DigYviXBNFt1XqTAly9/Vh9R9lfsMkWELOS9CWd0aKED9Ozup8fQCBAcvOxN sNpF/8/aIFsdiptZgJlMLyyjXWz1pfXGbMwpgotlpwEFUh+W6Ar/SKq6Kk4JcIB1UGka 1lDA==
- In-reply-to: <CAKc7PVA+Ch+XqDj4aZRErr28Qo+0sejvt-d7F7m09YooC9psUg@mail.gmail.com>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- List-unsubscribe: <mailto:email@example.com>
- 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+5cp1OsgikihLv0iUi2firstname.lastname@example.org> <CAN=4vMq9uM_myMu55xjZ-+483JUY+VnmeEd4kCpOqBc8SurwFg@mail.gmail.com> <CAKc7PVA+Ch+XqDj4aZRErr28Qo+0sejvt-d7F7m09YooC9psUg@mail.gmail.com>
On Wed, Oct 9, 2019 at 3:17 PM Sebastian Gniazdowski
> 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 &&/||.
Supposing that "if-then-else is too verbose" is a problem that
warrants extending zsh, a natural solution would be to provide an
alternative syntax for the same construct. Something analogous to
`x ? y : z` from C and other languages derived from it.
Note that C had an extra reason besides terseness to introduce this
syntax: if-then-else is a statement while the ternary is an
expression. This reason doesn't apply to zsh, which leaves saving
on typing as the only benefit of the contemplated innovation.
Since `x ? y : z` already has a meaning in zsh, the new syntax would
have to be different and likely unfamiliar to users.
All-in-all, doesn't seem worth the trouble. if-then-else has the
desired semantics, isn't more verbose than in other languages,
and is easy to read even for people unfamiliar with zsh.
Messages sorted by: