comp.lang.ada
 help / color / mirror / Atom feed
From: WELTY@GE-CRD.ARPA.UUCP
Subject: Re: C++ as a way to use private types in C
Date: Tue, 31-Mar-87 12:08:00 EST	[thread overview]
Date: Tue Mar 31 12:08:00 1987
Message-ID: <8704010054.AA00265@ucbvax.Berkeley.EDU> (raw)


Date: 31-MAR-1987 11:58
From: Richard Welty
Sender: WELTY
Subject: Re: C++ as a way to use private types in C
To: info-ada@ada20.isi.edu@smtp
--------
> ihnp4!chinet!nucsrl!gore@ucbvax.Berkeley.EDU  (Jacob Gore) writes:
>/ nucsrl:comp.lang.ada / WELTY@GE-CRD.ARPA (WELTY RICHARD P) /
>> Objects in C++ (like objects in Flavors, CommonLoops, Smalltalk, etc.)
>> may be dynamically allocated and freed -- Ada Generics are a somewhat
>> weaker notion.
>
>I'm not sure what you mean here.  My understanding is that you can instantiate
>a generic within a scope, thus "dynamically allocating" it.  When you leave
>the scope, it's gone, "dynamically freed"... sort of.  If the instance has
>allocated heap space during its life, that space is not deallocated
>automatically, but becomes the garbage collector's problem.

What I meant was that the objects are reasonably independent of scope --
I can allocate and free them in the course of normal execution, allocate
n of them inside of a loop, pass pointers to them, etc.  Ada has a distinctly
different style for handling this sort of thing.  You can use a package
to contain the type declaration for some object you want to declare along
with the functions for access to it.  In a system like C++, the functions
are considered to be a part of the object.  The resulting language has
a lot of interesting properties when it comes to things like scoping ...

			-- Richard Welty (welty@ge-crd.arpa)

--------

             reply	other threads:[~1987-03-31 17:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1987-03-31 17:08 WELTY [this message]
  -- strict thread matches above, loose matches on Subject: below --
1987-03-19 19:03 C++ as a way to use private types in C WELTY RICHARD P
1987-03-20 14:35 ` bs
1987-03-19 16:20 WELTY RICHARD P
1987-03-19  3:09 larry
1987-03-19 16:40 ` bs
1987-03-19 16:57 ` Greg Lomow
1987-03-20 14:03   ` firth
1987-03-20 14:55 ` Leonard Vanek
1987-03-21  3:45 ` gore
replies disabled

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