From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 6a7fedcc for ; Wed, 9 Oct 2019 17:37:00 +0000 (UTC) Received: (qmail 9539 invoked by alias); 9 Oct 2019 17:36:52 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24339 Received: (qmail 11049 invoked by uid 1010); 9 Oct 2019 17:36:51 -0000 X-Qmail-Scanner-Diagnostics: from out4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25594. spamassassin: 3.4.2. Clear:RC:0(66.111.4.28):SA:0(-2.6/5.0):. Processed in 5.831391 secs); 09 Oct 2019 17:36:51 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) 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== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedriedugdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtugfgjggfsehtke dttddtredunecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceougdrshesuggrnhhi vghlrdhshhgrhhgrfhdrnhgrmhgvqeenucfkphepjeelrddukedtrdehjedrudduleenuc frrghrrghmpehmrghilhhfrhhomhepugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgr mhgvnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Date: Wed, 9 Oct 2019 17:36:07 +0000 From: Daniel Shahaf To: zsh-users@zsh.org Subject: Re: Feature request: a new warning option Message-ID: <20191009173607.rkvblvhq7vnoanya@tarpaulin.shahaf.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) 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