From: tmoran@acm.org
Subject: Re: ML-like alternatives to out parameters for functions
Date: Tue, 18 Mar 2003 21:09:24 GMT
Date: 2003-03-18T21:09:24+00:00 [thread overview]
Message-ID: <7WLda.129634$eG2.17105@sccrnsc03> (raw)
In-Reply-To: m365qhh8ju.fsf@valhal.vikingnet
> Am I wrong to assume that the Ada-way is definitely to use the
> discriminated return type, even in the case that Ada may get out
Any time you have two variables which only make sense together
but not separately, you have, conceptually, a single object. That
can be modelled nicely in this case with a discriminated record.
If you treat them as two separate things, there is always a significant
danger of erroneously letting them get out of sync with each other.
If profiling demonstrates that returning a discriminated record is
too slow for the app, then it may be worth while to go to in-lining
the calculation, separate variables, assembly language, etc.
next prev parent reply other threads:[~2003-03-18 21:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-17 22:17 ML-like alternatives to out parameters for functions Mark Lorenzen
2003-03-17 21:47 ` Stephen Leake
2003-03-17 23:34 ` Mark Lorenzen
2003-03-18 3:54 ` John R. Strohm
2003-03-18 8:59 ` Preben Randhol
2003-03-18 21:09 ` tmoran [this message]
2003-03-18 17:04 ` Frank J. Lhota
2003-03-18 18:52 ` Mark Lorenzen
2003-03-18 19:16 ` Frank J. Lhota
2003-04-01 3:39 ` Robert I. Eachus
2003-04-01 14:51 ` Frank J. Lhota
2003-03-18 8:37 ` Dmitry A. Kazakov
2003-03-18 9:07 ` Preben Randhol
2003-03-19 7:31 ` Mark Biggar
-- strict thread matches above, loose matches on Subject: below --
2003-04-02 0:23 Alexandre E. Kopilovitch
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox