comp.lang.ada
 help / color / mirror / Atom feed
* Re: C++ as a way to use private types in C
@ 1987-03-19 16:20 WELTY RICHARD P
  0 siblings, 0 replies; 10+ messages in thread
From: WELTY RICHARD P @ 1987-03-19 16:20 UTC (permalink / raw)



Date: 19-MAR-1987 11:01
From: Richard Welty
Sender: WELTY
Subject: Re: C++ as a way to use private types in C
To: info-ada@ada20.arpa@smtp, WELTY@CRDMAIL
--------

--------

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: C++ as a way to use private types in C
@ 1987-03-31 17:08 WELTY
  0 siblings, 0 replies; 10+ messages in thread
From: WELTY @ 1987-03-31 17:08 UTC (permalink / 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)

--------

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: C++ as a way to use private types in C
@ 1987-03-19 19:03 WELTY RICHARD P
  1987-03-20 14:35 ` bs
  0 siblings, 1 reply; 10+ messages in thread
From: WELTY RICHARD P @ 1987-03-19 19:03 UTC (permalink / raw)



Date: 19-MAR-1987 13:52
From: Richard Welty
Sender: WELTY
Subject: Re: C++ as a way to use private types in C
To: info-ada@ada20.arpa@smtp
--------
Argh!  This is a reconstruction of the earlier posting that I refered to
in an earlier posting (our mailer blew it ...)

> Larry @ jpl-vlsi.arpa writes:

>C++ is very similar to Ada, except for tasking where the older C-style
>facilities are used.

C++ contains a number of serious differences, actually ...

Objects in C++ (like objects in Flavors, CommonLoops, Smalltalk, etc.)
may be dynamically allocated and freed -- Ada Generics are a somewhat
weaker notion.  Also, C++ provides single inheritance (unfortunately,
it does not support multiple inheritance; its designers feel that multiple
inheritance has unacceptable performance penalties).

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

--------

^ permalink raw reply	[flat|nested] 10+ messages in thread
* C++ as a way to use private types in C
@ 1987-03-19  3:09 larry
  1987-03-19 16:40 ` bs
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: larry @ 1987-03-19  3:09 UTC (permalink / raw)


--
If you want private types in C the best way is to get a C++ to C translator. 
There are at least three available for the PC family and several for various
minis.  (I understand AT&T has compilers (as opposed to translators) for
some of their 3B computers also.)

C++ is very similar to Ada, except for tasking where the older C-style
facilities are used.  It's also upwardly compatible with C except for some
minor details; for instance, you can't use the about a half-dozen keywords
C++ uses.  It also has an advantage over Ada in that functions are data
objects, so can be passed as parameters, etc.

C++ also has a number of disadvantages, most fostered by a need to remain
compatible with C felt by its its designers (primarily Bjourne Stroustrup
but with a lot of input from the prime C theorists at AT&T).

Has anyone on the list done a detailed comparison between C++ and Ada?

               Larry @ jpl-vlsi.arpa

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1987-03-31 17:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1987-03-19 16:20 C++ as a way to use private types in C WELTY RICHARD P
  -- strict thread matches above, loose matches on Subject: below --
1987-03-31 17:08 WELTY
1987-03-19 19:03 WELTY RICHARD P
1987-03-20 14:35 ` bs
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

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