comp.lang.ada
 help / color / mirror / Atom feed
From: "Corey Ashford" <corSPAMey@rational.com>
Subject: Re: Parameter evaluation order
Date: 1998/04/06
Date: 1998-04-06T00:00:00+00:00	[thread overview]
Message-ID: <6ga50i$f29$1@usenet.rational.com> (raw)
In-Reply-To: 6g9d2o$tfg$1@nnrp1.dejanews.com



Mark.Rutten@dsto.defence.gov.au wrote in message
<6g9d2o$tfg$1@nnrp1.dejanews.com>...
>
>
>I'm using GNAT3.09 on WindowsNT (and also Solaris, but I didn't get
>this problem).
>
>I compiled a procedure call similar to the following
>
>  proc(func_one,func_two);
>
>The program relies on func_one being called _before_ func_two. But
>at run-time the code above did the opposite! Is this a bug (and if so, has
it
>been fixed in 3.10)? Or is there something written in the language
definition
>to justify this behaviour?
>
>Thanks,
>Mark Rutten


See the Ada RM 6.4 (10)

(10)
    For the execution of a subprogram call, the name or prefix of the call
is evaluated, and each parameter_association is evaluated (see 6.4.1).
    If a default_expression is used, an implicit parameter_association is
assumed for this rule. These evaluations are done in an arbitrary order.
    The subprogram_body is then executed. Finally, if the subprogram
completes normally, then after it is left, any necessary assigning back of
    formal to actual parameters occurs (see 6.4.1).








  parent reply	other threads:[~1998-04-06  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-05  0:00 Parameter evaluation order Mark.Rutten
1998-04-05  0:00 ` Matthew Heaney
1998-04-07  0:00   ` Don Harrison
1998-04-09  0:00   ` Simon Wright
1998-04-10  0:00     ` Matthew Heaney
1998-04-10  0:00       ` Simon Wright
1998-04-11  0:00         ` Robert Dewar
1998-04-06  0:00 ` William D. Ghrist
1998-04-06  0:00 ` Corey Ashford [this message]
1998-04-08  0:00 ` Glenden Lee
1998-04-09  0:00   ` Robert Dewar
     [not found]     ` <Er5Ir9.5Ip@world.std.com>
1998-04-09  0:00       ` Peter Amey
1998-04-09  0:00       ` Tucker Taft
1998-04-16  0:00         ` Nick Roberts
1998-04-17  0:00           ` Robert Dewar
replies disabled

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