From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ncsu.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!decvax!mcnc!ncsu!mauney From: mauney@ncsu.UUCP (Jon Mauney) Newsgroups: net.lang,net.lang.ada Subject: Abstraction In Ada Message-ID: <2620@ncsu.UUCP> Date: Mon, 18-Jun-84 15:28:31 EDT Article-I.D.: ncsu.2620 Posted: Mon Jun 18 15:28:31 1984 Date-Received: Wed, 20-Jun-84 00:47:05 EDT References: <1979@mit-eddi.UUCP> <5400007@ea.UUCP> <7506@umcp-cs.UUCP>, <2144@mit-eddie.UUCP> Organization: N.C. State University, Raleigh List-Id: Ada is a complicated and rather ponderous language, and I can understand why people might not like it. But I think that one of Ada's strengths is a pretty good data abstraction facility. Therefore I would like to see an elaboration of any complaints in that area. Specifically: (from mit!nessus) > To do a good job with data abstraction, you really need heap-based > allocation with automatic garbage collection. Ada doesn't support this. I don't see how this follows, except that lack of a garbage-collected heap restricts your ability to implement an ADT using a garbage-collected heap. There are advantages and disadvantages to heap allocation of data objects; I don't see how they relate to abstraction. > Also, Ada's private type system is completely messed up. "Private > types" have their assignment and equality operations provided by the > system. This is the wrong thing since two abstract objects may be > different from the concrete view (the view that Ada's "=" operation > takes), but equal from the abstract point of view. And the assignment > operation is supposed to copy the object being assigned, but the system > provided operation can't do that right either. You can do a little > better with "limiited private types". You can then provide your own "=" > operation, but you still can't provide your own ":=" operation. And > even if you do define your own "=" operation for a limited private type, > Ada then won't allow you to use "=" on a composite type that contains > that type. Ada gives the "package" designer three choices: (A) a type can be declared right in the package specification, which means everyone can use the information to write code that is totally dependent on the particular representation chosen. (B) a type can be declared "private," which means that even though everyone knows how the type is implemented, they can't write code that depends on it. Two operations, assignment and equality testing, are provided by the system. This is convenient in many cases, because the system-supplied operations are exactly what you want. (C) a type can be declared "limited private." In this case the only operations supplied by the system are declaration of variables (an essential ability) and passing as parameter (also essential). This is useful in many cases, because the system-supplied operations are not appropriate to the particular abstraction or implementation. The '=' operator may be overloaded, and definition of '=' automatically implies definition of '/='. Sad to say, ':=' is not an operation that can be overloaded, and assignment of limited private types must be done using a different syntax. This system is not without its defects, but is it really so horrible? > Basically, Ada is just gross. Bleah! The above opinion is frequently heard. Practically every language has been substituted for Ada at some point. This prompts me to issue the following challenge, pretty much unrelated to the above discussion: Can you name a language that will not elicit a "Bleah" from someone on the net? Languages so obscure that no one on the net has heard of them do not qualify. Mail any suggestions to me; I will collect them and try to find an objective method of getting a response from the net at large. The winner will receive a barbeque sandwich from the Blue Mist, Asheboro, NC. -- _Doctor_ Jon Mauney, mcnc!ncsu!mauney \__Mu__/ North Carolina State University