comp.lang.ada
 help / color / mirror / Atom feed
From: hmj@tut.fi (Matti J{rvinen)
Subject: Re: Side Effects
Date: 14 Apr 88 07:55:32 GMT	[thread overview]
Message-ID: <3111@kuukkeli.tut.fi> (raw)
In-Reply-To: 8804112114.AA03398@ajpo.sei.cmu.edu

In article <8804112114.AA03398@ajpo.sei.cmu.edu> jmoody@DCA-EMS.ARPA (Jim Moody, DCA C342) writes:
>The order in which the components are evaluated is not determined by
>the language (LRM 3.2.1(15), last sentence).

So there is an inconsistency here (?):
LRM 3.2 (13) states that multiple declaration
a,b : T := func;
is equivalent to
a : T := func;
b : T := func;
IN THIS ORDER.

LRM 3.9 (3) states that elaboration must occur in the order given.

In fact, LRM 3.2.1 (15) refers to elaboration of ONE object (e.g. record).
One should not apply it to multiple declaration, so summa summarum:
values must be 1,2,3,4,5,6, in this order.

>What this goes to show is that writing function with side effects is a very,
>very risky business in Ada.  Actually, it's a risky business in any language,
>but Ada makes the risk explicit.

No. Ada zeros the risk.



-- 
Hannu-Matti Jarvinen, Tampere University of Technology, Finland
hmj@tut.fi, hmj@tut.uucp, hmj@tut.funet (tut.ARPA is not the same computer).

      reply	other threads:[~1988-04-14  7:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-04-11 20:00 Side Effects Jim Moody, DCA C342
1988-04-14  7:55 ` Matti J{rvinen [this message]
replies disabled

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