Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16027

Re: Are there any plans for more readable, modern syntaxes for If statements?

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Eli Schwartz <eschwartz@archlinux.org>
Newsgroups gnu.bash.bug
Subject Re: Are there any plans for more readable, modern syntaxes for If statements?
Date Fri, 13 Mar 2020 09:27:34 -0400
Lines 83
Approved bug-bash@gnu.org
Message-ID <mailman.2594.1584106066.2412.bug-bash@gnu.org> (permalink)
References <CAB+qc9AAPQbzp92tv-FOR4Kh+2UdZyRwGiPOfNegVqv5UFnU5Q@mail.gmail.com> <f1d0d39d-b6e6-c33e-7463-226f6994b99e@archlinux.org> <CAAJSdjidSYg1yoWC7UbbLUUDF3ug9ekDtkOP7Er-JOjrLoDssQ@mail.gmail.com> <81145cad-63a1-f67c-1cc1-3fbdaa5d2930@archlinux.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z3JnAQK8zDJBf62xtjIY9VKsSjkQlVOTn"
X-Trace usenet.stanford.edu 1584106066 15847 209.51.188.17 (13 Mar 2020 13:27:46 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org
To John McKown <john.archie.mckown@gmail.com>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1584106057; bh=ssMynuhSF9nQAsxAIBWxDKLvDZpM3rf3S8OrRaUE6ZY=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=AQchUrx+Gs/8Ks50NlUpBBZF0L9vGsRlsKcKgczUeOkdkJSQRcJFSiUIMlRe9TuRW 7J8+iMwbv34hhT+u1jY2cT8rKoxxkv3yYPo9z56O7dupexR0Mf6nR/rVirAceYr+LD QjP5s6e/4eIusvX55AY0WonQr9ihGgOfmLC1GVOkZiV96GlXGMj1vCWTqcTJ8AaP14 Amrqa6XQASyAkIIVh+EkmHzO2cWFfkBdjP19rB/e2hjWFHzvsuppW8/aHdp+2z6DX9 y+uvjXyyk8CMYNftPaYgWTWhif/WhZpyd8oIiZU0CsjW/fbiteMudTrbhvyU120SBI AOHUzQYn5At9PLDZeg5SV+J984jr/wW0715icH+HMamrs7w9KK6tcDaKv5Y2Y108w0 LUvCI9+3aZAKxSEdJii4r6O6WHsT0MLijmbPOTSFoU+7ukQf2WL+C3lsuYzwR+V2bq 6CsBnAPwjAGxkBKyT3kxiWnxt506oow+25R1DRjEZf7+jaUJd29gLNVpwuAUUfaxlV mKMI0+4Ws79RGePCcq0SXTHTXpQMt9vVDgODbIxGH5cubldNuhCGL4DV0RV4hO5E6X YjkHeC71LtmttRHU2zkBEBFDxRD7Vv5SWtLxYdTZjLW88Z7KQ89JEoHPdWjnGczjjG +whsbkrwAz2GNpQ8lYZd3N6w=
X-Clacks-Overhead GNU Terry Pratchett
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0
In-Reply-To <CAAJSdjidSYg1yoWC7UbbLUUDF3ug9ekDtkOP7Er-JOjrLoDssQ@mail.gmail.com>
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy]
X-Received-From 88.198.91.70
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <81145cad-63a1-f67c-1cc1-3fbdaa5d2930@archlinux.org>
X-Mailman-Original-References <CAB+qc9AAPQbzp92tv-FOR4Kh+2UdZyRwGiPOfNegVqv5UFnU5Q@mail.gmail.com> <f1d0d39d-b6e6-c33e-7463-226f6994b99e@archlinux.org> <CAAJSdjidSYg1yoWC7UbbLUUDF3ug9ekDtkOP7Er-JOjrLoDssQ@mail.gmail.com>
Xref csiph.com gnu.bash.bug:16027

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On 3/13/20 7:59 AM, John McKown wrote:
> I do things like:
> 
> test <some relational test> && { true_command1;true_command2; : ; } || {
> false_command1; false_command2; false_command3; }
> 
> Notice the command : (colon) as the last command in the true. The reason
> that I put it there is to guarantee that the $? from the series of
> "true_commnds" is 0 (aka "true") so that the commands in the || are not
> executed.

OP: "I want readable, modern syntax for If statements, inspired by C."

You: "Don't use If, use &&, which doesn't look like a C If either."

I'm... not following? I mean, yes, the things which you do are valid
bash syntax, and yes, they seem to do what you want them to do, but I
don't *really* understand how they tie in to the premise of the thread.

In contrast, "abuse parser macros" is a valid if terrible answer to the
question of changing the syntax of a bash feature. Something which is
otherwise not really an option, since 40-year-old languages do not
change fundamental syntax on a whim as though they are, I dunno, perl6.

(I am still mindblown that "I want a modern syntax for XXXX" can
possibly lead to "imitate C, which is 50 years old and thus astoundingly
even less modern than the Bourne shell by an entire decade".)

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Are there any plans for more readable, modern syntaxes for If statements? Eli Schwartz <eschwartz@archlinux.org> - 2020-03-13 09:27 -0400

csiph-web