comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not>
Subject: Re: Ada needs some modernization
Date: Wed, 1 Jun 2022 21:00:31 +0200	[thread overview]
Message-ID: <t78d0h$fa8$1@dont-email.me> (raw)
In-Reply-To: <75d90749-242f-42b8-ba0b-299f7ac693e0n@googlegroups.com>

On 2022-05-31 19:54, Matt Borchers wrote:
> 
> What amendment can we suggest to the Ada syntax so the if expression be better written when used in an if statement?  I know other languages support this and it often looks like  A ? B : C  or something similar.  That's certainly not Ada-like IMO, but I can't think of something better. These same languages often also have a null check operator  A ?? B  (where A and B are access types of the the same Type) such that if A is not null then A is returned otherwise B is returned.  So useful and helpful!

What you call "modernization" looks to me a lot like "repeating mistakes that 
Ritchie made over 50 years ago".

"A ? B : C"? Or is it "A : B ? C"? If only there were a less cryptic, easier to 
remember and understand way to express it. Something like "(if A then B else 
C)", for example.

"A ?? B" might be "useful and helpful" if you use (or think in) a language with 
pointers to objects everywhere, but in a language where such pointers are never 
needed, like Ada, it is neither, especially since a conditional expression would 
handle it just fine if it were ever needed.

> I often find myself writing a loop to search ... 

When you write something for a second time, it's a signal to create a subprogram 
or package to avoid writing it a third time.

-- 
Jeff Carter
"You empty-headed animal-food-trough wiper."
Monty Python & the Holy Grail
04

  parent reply	other threads:[~2022-06-01 19:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 17:54 Ada needs some modernization Matt Borchers
2022-05-31 19:05 ` Gautier write-only address
2022-05-31 19:55 ` Dmitry A. Kazakov
2022-05-31 22:46 ` Randy Brukardt
2022-06-01  7:24   ` John McCabe
2022-06-01 19:00 ` Jeffrey R.Carter [this message]
2022-06-02  5:56 ` G.B.
2022-06-10 16:38 ` Brad Moore
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox