comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@linus.mitre.org (Robert I. Eachus)
Subject: Re: "silly" (?) Ada semantics
Date: 6 Jun 90 18:12:28 GMT	[thread overview]
Message-ID: <EACHUS.90Jun6141228@aries.linus.mitre.org> (raw)
In-Reply-To: ken@minster.york.ac.uk's message of 5 Jun 90 09:54:43 GMT

In article <644579683.25696@minster.york.ac.uk> ken@minster.york.ac.uk writes:

> I thought Ada was targetted at high integrity mission critical
> software? Is it a good idea to defer errors to run-time? 

     No, but it is an even worse idea to allow SOME compilers to
reject a program because it thinks the program is silly, or because
as, "a matter of taste" some vendor thinks that a particular construct
is not a good idea.

     In this particular case, it is obvious at compile time that the
aggregate must be invalid, but in general it is not possible to decide
whether an aggregate is "legal" until run time:

     A: String(1..X) := "foo";

     Given that in many cases the decision must be deferred until
run-time, the chosen policy was that mismatch is never a compile-time
error, but a compiler is expected to flag a known mismatch.  A
similar, but less surprising case is:

   declare
     X: Integer;
   begin
     X := Integer'LAST + Integer'LAST;
   end;

     A compiler can flag this, and in fact it can replace the
assignment statement with "raise CONSTRAINT_ERROR;", but it is
required to generate code...

--

					Robert I. Eachus

with STANDARD_DISCLAIMER;
use  STANDARD_DISCLAIMER;
function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...

  parent reply	other threads:[~1990-06-06 18:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-06-02 21:08 "silly" (?) Ada semantics Michael Feldman
1990-06-05  9:54 ` ken
1990-06-06 16:09   ` Michael Feldman
1990-06-06 22:27     ` Robert I. Eachus
1990-06-07 14:32       ` Michael Feldman
1990-06-06 18:12   ` Robert I. Eachus [this message]
1990-06-07 17:27 ` stt
replies disabled

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