comp.lang.ada
 help / color / mirror / Atom feed
From: pattis@june.cs.washington.edu (Richard Pattis)
Subject: Re: Ada language revision
Date: 23 Nov 88 21:14:17 GMT	[thread overview]
Message-ID: <6516@june.cs.washington.edu> (raw)
In-Reply-To: 6843@pyr.gatech.EDU

In article <6843@pyr.gatech.EDU>, tynor@pyr.gatech.EDU (Steve Tynor) writes:
> Here, here. I think the Modula 2 compromise of requiring 'opaque' types to be
> pointers is adequate. This way there is enough information supplied in the
> specification for code generation in client packages, but the implementation 
> details are not broadcast.  Sure, the code may be slightly less efficient
> (since you're forced to use a pointer), but I've rarely run into a situation
> where I've wanted to create an ADT where a pointer (ok, ok, 'access
> type') wasn't the natural representation anyway...
> 
>     Steve Tynor
>     Georgia Tech Research Institute
>     tynor@gitpyr.gatech.edu

  As someone who has taught Modula-2 in introductory courses for 4 years (4
times a year) I've voted with my feet and switched to Ada.  Private types are
one reason.  While opaque types do allow for easier portability, and a link
time decision of which imlementation to use, there are some drawbacks.

  For teaching, the concept of a protected object is important and is easy to
motivate.  But by requiring students to learn about dynamic allocation and
deallocation to implement such a type, Modula-2 makes it very hard for me to
intoduce this concept early.  Also, the newest M-2 standard (at least that I
have seen) proposes to restrict opaque types to pointer only, disallowing me
to define an opaque cursor that in one instance must be implement by integer
that refers to some location in an array.

  Also, there are all sorts of problems with initialization/finalization in
Modula-2's opaque types.  Try writing a complex number type and functional
versions of the standard arithmetic operators, including garbage collection.

  Finally, if I recall my Ada correctly, one can use access types in Ada to
implement private types that are equivalent to Modula-2's opaque types, at
least with regard to portability problems residing in package bodies.  I
believe Cohen's book had a discussion of this use of access types in the
private parts of packages.

  reply	other threads:[~1988-11-23 21:14 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-11-14 13:20 Ada language revision Stanley Roger Allen, AdaDude
1988-11-15 23:28 ` Wilmer Rivers
1988-11-16 19:06   ` William Thomas Wolfe,2847,
1988-11-17 15:34     ` Stephe Leake
1988-11-18 16:39       ` Steve Tynor
1988-11-18 19:22       ` Ron Guilmette
1988-11-23 22:22       ` William Thomas Wolfe,2847,
1988-11-29 15:35         ` Stephe Leake
1988-11-18  0:32     ` Ron Guilmette
1988-11-22 14:37       ` Stephe Leake
1988-11-23 13:37         ` Dennis Doubleday
1988-11-23 19:41           ` Steve Tynor
1988-11-23 21:14             ` Richard Pattis [this message]
1988-11-25 20:36             ` Robert Firth
1988-11-29 15:12           ` limited private types Stephe Leake
1988-12-01 23:06             ` Ron Guilmette
1988-12-05  1:48               ` Paul Stachour
1988-12-05 12:31                 ` Reference Semantics William Thomas Wolfe,2847,
1988-12-06  0:29                   ` Paul Stachour
1988-12-07  1:07                     ` Reference Semantics, assignment overloading, etc Ray Trent
1988-12-08 17:36                       ` Reference Semantics, assignment ryer
1988-12-06 16:56               ` limited private types ryer
1988-12-06 20:09               ` stt
1988-12-07 15:51               ` Stephe Leake
1988-11-21 15:40   ` Ada language revision stt
  -- strict thread matches above, loose matches on Subject: below --
1988-11-28 22:19 Collective response to := messages Geoff Mendal
1988-11-29 14:39 ` Dennis Doubleday
1988-11-29 21:08 ` Ray Trent
1988-11-30 14:37   ` Stephe Leake
1988-12-01 14:54     ` David S. Rosenblum
1988-12-02 20:21       ` William Thomas Wolfe,2847,
1988-12-04 21:15         ` David S. Rosenblum
1988-12-04 23:27           ` William Thomas Wolfe,2847,
1988-12-05 14:46             ` David S. Rosenblum
1988-12-05 21:23               ` William Thomas Wolfe,2847,
1988-12-07 17:33                 ` Stephe Leake
1988-12-07 16:03               ` Definition of pass by reference Robert Eachus
1988-12-07 17:15             ` Collective response to := messages Stephe Leake
1988-12-07 16:07       ` Stephe Leake
1988-12-09  3:15         ` David S. Rosenblum
1988-12-01 21:31     ` Ray Trent
1988-12-07 16:21       ` Stephe Leake
1988-11-30 16:29   ` David S. Rosenblum
1988-11-30 18:29     ` William Thomas Wolfe,2847,
1988-11-30 22:28       ` David S. Rosenblum
1988-12-01  3:09         ` William Thomas Wolfe,2847,
1988-12-01 15:16           ` David S. Rosenblum
1988-12-02 19:31             ` William Thomas Wolfe,2847,
1988-12-04 21:03               ` David S. Rosenblum
1988-12-05  2:34                 ` William Thomas Wolfe,2847,
1988-12-05 14:07                   ` David S. Rosenblum
1988-12-07 17:26                     ` Stephe Leake
1988-12-06 19:16                 ` Collective response to := messa stt
1988-12-09  3:39                   ` David S. Rosenblum
1988-11-30 19:13     ` CORRECTION Re: Collective response to := messages David S. Rosenblum
1988-12-01 18:31     ` Ray Trent
1988-12-02 14:49       ` David S. Rosenblum
1988-12-05 17:33         ` Collective response to := messa stt
1988-11-30 18:24   ` Collective response to := messages Robert Eachus
1988-12-02 14:58     ` David S. Rosenblum
1988-12-02 19:34   ` Mark C. Adolph
1988-12-05 17:15     ` Collective response to := messa stt
1988-11-29 21:44 ` Collective response to := messages William Thomas Wolfe,2847,
1989-07-26 20:34 Memory Access Question tony
1989-07-27 13:06 ` richard a hammond
1989-07-27 18:53   ` Ray Trent
1989-07-28  0:48     ` Mike Murphy
1989-08-02 13:23       ` Mike Walsh
1989-08-02 20:20         ` Mike Murphy
1989-07-29  0:00 ` Brian Sullivan
replies disabled

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