comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: can ada do this?
Date: Fri, 17 May 2019 20:42:07 -0400
Date: 2019-05-17T20:42:07-04:00	[thread overview]
Message-ID: <edkude9c06dugri4qu8hjidcrhlbn9648s@4ax.com> (raw)
In-Reply-To: 8ffb8275-a360-430d-aa96-394738328e10@googlegroups.com

On Fri, 17 May 2019 07:42:00 -0700 (PDT), gautier_niouzes@hotmail.com
declaimed the following:

>> Some Adaphiles yearn for a more-pandering-to-popularity AdaNG (Ada next generation) that, say, has braces instead of BEGIN END, and numerous other shallow “features”.
>
>The braces replace exactly the BEGIN END pair in *Pascal* (they are needed for framing more than one instruction). In Ada the BEGIN END pair is only for subprograms, or blocks (with or without DECLARE) but the IFs, LOOPs and CASEs don't need it. Basically groups of instructions don't need to be framed in Ada, so where would you
put your braces ?... In the end you would have a mess with some braces and some "end loop" etc.


	Since {} are used in those languages to /group statements/ where the
syntax says "a statement", making an Ada-esque language means making a
syntax were control blocks are NOT delimited... dropping "loop/end loop",
"then/end if", et al, requiring conditionals to be wrapped in (), and
allowing
	if (conditional)
		a statement;
	else
		another statement;

Ada's 
	if condition then
		a statement;
	else
		another statement;
	end if;

is an improvement over the error prone use of {} to group statements within
syntactically "single statement" parts of the language.

	And I thought people complaining about Python's use of indentation to
block statements was ridiculous -- since most programmers I know already
indent code to reflect the semantics, having the language /use/ that
indentation for syntax meant one didn't have to provide {} or begin/end
(loop/end loop, etc.).

	Avoiding {} as grouping also minimizes the infernal fight over
placement. Is it...

	if (cond) {
		statements;
	}
(UGH -- if that were a required form I'd likely define macros for THEN and
ENDIF [and the rest of the gang])

	if (cond)
		{
			statements;
		}

(small ugh -- too many indentation levels eaten for nothing)

	if (cond)
	{
		statements;
	}

(which is my preference in those languages, as it puts the {} directly in
line with the keyword for which they are grouping the statements)


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed@ix.netcom.com 


  parent reply	other threads:[~2019-05-18  0:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 15:05 can ada do this? Rabican
2019-05-10 16:45 ` Shark8
2019-05-10 17:53   ` Optikos
2019-05-13  6:02   ` Maciej Sobczak
2019-05-13  8:21     ` Niklas Holsti
2019-05-17  1:57     ` Rabican
2019-05-17 22:59       ` Shark8
2019-05-17  1:58   ` Rabican
2019-05-17  5:39     ` Maciej Sobczak
2019-05-17 13:52       ` Optikos
2019-05-17 14:42         ` gautier_niouzes
2019-05-17 20:36           ` Optikos
2019-05-18  0:42           ` Dennis Lee Bieber [this message]
2019-05-29 18:22       ` Rabican
2019-05-10 18:00 ` Per Sandberg
2019-05-10 23:56 ` Stephen Leake
replies disabled

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