Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature request: a new warning option
- X-seq: zsh-users 24339
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Feature request: a new warning option
- Date: Wed, 9 Oct 2019 17:36:07 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm1; bh=kE+a+eddzSQDSOsoYTv9qisWCJiZX+0c1TiJhilC 9vc=; b=rprIDc23DVmE1NrCfz9pGSTvy8oxsw9NodupL7rZsuFeJkNUGVFIxOX0 ZWctqP0e5yyBUpH2aN6EMZu1H3TTJ3mQpYtFsmTwxaqk6hgbW7zAuoDjO/iU+o6q 0d1nybguwXaYzzAIfPSRyVfcCEZ3ZClrFCtHq9irIKbpL19ZdNAw38v0w/A5i9aq p2DY5T1nGSudKt+ennPIKnYGHk24AG2avsIAyvjcTBH/Nwn3n8DnvJlgFza3riEl y0WNGljSyrcwagZ0hmfL1lZTddybESWXBURBzawEsHN+Mec0mJW/9PnWkAWafFua zxAx+2d/V0NCB0hk3ULgCNFDSXCucw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=kE+a+eddzSQDSOsoYTv9qisWCJiZX+0c1TiJhilC9 vc=; b=nLOTDcZ1JDP6RHsCus6VPtE/O2NybY7+dM5473cZHIXJ+34a+D9vGQhJK Ql847f8kF68lfY4P2xlJ2n/shHdSdhzTyHepiGt5N8uKsJBVM6egjxA5s50tlsOi Il656MZ2qlXqZUAN/u+se+JwieQF2e5sO7V8m4KfJVLmvR9KGxZERKRv/tEf+J/W pWfgWo8WtdtUrKJ1LD8H0vg5pmS5rJKdeqYHVjkF5fGpsKvb+xo9zlF8h4IOkszK f6EKunibcG9KC8CU6YjR4QQV7e9hYL73R2ljp1wE0a/HVbV38gnnGM8mXXnjiytn 374JwUptT4oQReXzbZDu0IM9gS4cw==
- In-reply-to: <CAN=4vMpjCWOF24ybeyN79EsCxaV6POjn85Vhf3n8BdcLE2g7rQ@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> <CAKc7PVA+Ch+XqDj4aZRErr28Qo+0sejvt-d7F7m09YooC9psUg@mail.gmail.com> <CAN=4vMpjCWOF24ybeyN79EsCxaV6POjn85Vhf3n8BdcLE2g7rQ@mail.gmail.com>
Roman Perepelitsa wrote on Wed, Oct 09, 2019 at 15:40:48 +0200:
> 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.
Extending the SHORT_LOOPS form of «if» to allow an «else» comes to mind, but
I'm honestly not sure if it'd be a good change to make.
> 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.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author