comp.lang.ada
 help / color / mirror / Atom feed
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Subject: Re: Assignment Overload in Ada-9X
Date: 25 Mar 93 21:40:36 GMT
Date: 1993-03-25T21:40:36+00:00	[thread overview]
Message-ID: <1993Mar25.214036.6185@wdl.loral.com> (raw)
In-Reply-To: 11815@prijat.cs.uofs.edu

In article <11815@prijat.cs.uofs.edu> beidler@guinness.cs.uofs.edu (Jack Beidler) writes:
>I recently received a copy of the "Ada 9X Project Report dated
>February 1993.  On the top of page 48 in this report there is a
>statement about overloading assignment, specifically,
>	".., in the case of non-limited control types, assignment
>	can be redefined by the user."
>I curious about the form of the overload.  Is it soomething like
>procedure ":=" (Left : in out Some_Type ; Right : in   Some_Type) ?
>or have I misread this statement?

Not really, the report just doesn't go into enough detail.  You don't get
to actually override ":=", what you get to override are the underlying
routines: INITIALIZE, CLONE and FINALIZE.

INITIALIZE is used to prepare the left hand side for assignment,
CLONE is used to actually create the copy of the right hand side,
and FINALIZE is used to destroy the overwritten left hand side.

FINALIZE is also used when a controlled type goes out of scope.
A controlled type is any type derived for the system defined tagged type 
CONTROLLED.

See the ILS for more detail.

--
Mark Biggar
mab@wdl1.wdl.loral.com



  reply	other threads:[~1993-03-25 21:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-03-19 22:28 In favor of tagged types (was Classes versus tagged types was Ichibah flames, and flames out over, Ada 9X) John Goodsen
1993-03-21  3:20 ` Alex Blakemore
1993-03-25 19:07 ` Assignment Overload in Ada-9X Jack Beidler
1993-03-25 21:40   ` Mark A Biggar [this message]
1993-03-25 22:29   ` Robert I. Eachus
replies disabled

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