comp.lang.ada
 help / color / mirror / Atom feed
From: sommar@enea.se (Erland Sommarskog)
Subject: Re: Overloading of ":="
Date: 26 Dec 88 13:07:14 GMT	[thread overview]
Message-ID: <4193@enea.se> (raw)

Bill Wolfe (billwolf@hubcap.clemson.edu) writes:
>From article <4189@enea.se>, by sommar@enea.se (Erland Sommarskog):
>> [Mats Weber and Erland Sommarskog rehash the argument about
>>   assignment procedures having an "in out" parameter for the destination] 
>> 
>>   Now, WHY, is A of mode "in out" in the Assign procedure? If we had
>> "out" only, nothing "erroneous" could occur. 
>
>     Because the ASSIGN procedure needs to be able to DESTROY the old
>     value; DESTROY procedures must read objects during the process
>     of destroying them.  Please review the recent discussion rather
>     than recreating it, unless there are new issues to be considered.

Talk about rehash. We all know, except Bill of course, that the memory-
management problem is best handled with garbage collection.

As for the answer to the question above, the answer is simply that
   Generic
      Data_type is limited private;
      With  procedure Assign(A : out Data_type; B : in Data_type);
   Package...
is illegal. Parameters of a limited type may not be in "out" mode.
  This means, as Mats pointed out, that to use this package for 
type without a default value, like standard.integer, the user have to  
do something erroneous. I, in my turn, pointed out that this was not
a problem in practice except for constrained types, and that this
case also easily was handled with a "supress" pragma.

Please read more carefully before you flame. We didn't talk about
memory management. We didn't even talk about access types.-- 
Erland Sommarskog
ENEA Data, Stockholm              This signature is not to be quoted.
sommar@enea.se

             reply	other threads:[~1988-12-26 13:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-12-26 13:07 Erland Sommarskog [this message]
1988-12-28  5:46 ` Overloading of ":=", ADT survivability William Thomas Wolfe,2847,
  -- strict thread matches above, loose matches on Subject: below --
1988-12-24 22:02 Overloading of ":=" Erland Sommarskog
1988-12-25 19:27 ` William Thomas Wolfe,2847,
1988-12-20 13:05 Mats Weber
replies disabled

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