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,FREEMAIL_FROM,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 2d5fe7ce for ; Wed, 9 Oct 2019 13:41:40 +0000 (UTC) Received: (qmail 12119 invoked by alias); 9 Oct 2019 13:41:34 -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: 24334 Received: (qmail 5448 invoked by uid 1010); 9 Oct 2019 13:41:34 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f48.google.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(209.85.166.48):SA:0(-2.0/5.0):. Processed in 0.943025 secs); 09 Oct 2019 13:41:34 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.48 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=PRxcrhV3Cvrm5a5Uq0OjE7hTAdcMBJBFDn+l5FeAqF8=; b=I0kUbV41wNRzfw3YU4AeC7y06wj2i5qBHg4mLkmtOQo0ITXPPyMQ5LBTfoO5oEPito Mc3xs9dhBiGzN3tIkr3lB46m2TbWJWtbdhxjl+j5n385BwF2Fjx432hTjKtEJfw3ag84 POifXzrujZY/jU8M7k5jrUZlHEcDeHEHW4K5DiV4hWycmVsKKjpj+LwO9fB5VRDE3Pgo ytpZtIDOB7o+HQ1wMVgbvSzAJ+gOoPq5TFtgULzQtNtPYVW7fd5psZxAbqAcQ9SV6tSx AiDvwwrxKSvs5H10E8SJviAr8N12VckY4++NfXlPMPfj7EjeJN/lSo3IkBsz4xaGjwDT dzbw== X-Gm-Message-State: APjAAAXKXmEyiPWxJ+67AUmWQOJlw2pMPNvesuCCkfb6eEwhhcYBDB4d VdGeNDn9D6Kef80y0RePMzK39hlw+XaYXrKRNR4= X-Google-Smtp-Source: APXvYqyvI1r5EvdMty0bg3M8vv1VCL+LAw7rSVWAvskxe6iA7SPmrG331VLuMJrMGN8PUKw+Wmup31X76JFsejhDDz4= X-Received: by 2002:a05:6638:3a6:: with SMTP id z6mr3148897jap.33.1570628459760; Wed, 09 Oct 2019 06:40:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Wed, 9 Oct 2019 15:40:48 +0200 Message-ID: Subject: Re: Feature request: a new warning option To: Sebastian Gniazdowski Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Oct 9, 2019 at 3:17 PM Sebastian Gniazdowski wrote: > The x && y || z is less verbose. It doesn't require `then' and `else' > and `fi'. I'm writing from my point of view =E2=80=93 that are the reason= s 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. Roman.