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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,155b49c9f46f66ec,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-26 21:01:03 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!swrinde!elroy.jpl.nasa.gov!delphi.cs.ucla.edu!whirlwind!typhoon!caldwell From: caldwell@typhoon.seas.ucla.edu (Andrew E. Caldwell) Subject: don't understand packages vs. objects/classes Sender: news@seas.ucla.edu (News Daemon) Message-ID: Date: Sun, 27 Nov 1994 04:42:06 GMT Organization: School of Engineering & Applied Science, UCLA. X-Newsreader: TIN [version 1.2 PL2] Date: 1994-11-27T04:42:06+00:00 List-Id: Could someone please help me understand this. Either there is a large group of syntactic constructs I missed in the manual, or I am still stuck in c++/smalltalk mode, or I just don't get it. It seems to me (in my VERY limited Ada knowledge) that packages are like classes for OOP purposes. They have the features of data hiding, and binding procedures with data, hiding implementation, etc. But, how do you get more than one of them in a procedure/function. For instance, if I define the package STACK to have the procedures POP which returns say, an integer, and PUSH(X:integer), and I want to use my STACK in a procedure, I do something like (please, although my Ada style may not be the usual as I'm new, I think it's clear what I'm asking, so...) with STACK; procedure foo is use stack; test:integer; begin --a procedure body end foo; and inside foo I can call test = POP; and this works. But, what if foo needed TWO stacks, or three? As STACK doesn't appear to be named, it doesn't look like an object. It's a support library, rather than a data type? But, that wasn't what I thought it was supposed to be. If it is just a library of functions, then does Ada have a class/object structre? How about all the OOP subjects I've seen on this list lately- surely it must. -andy caldwell@seas.ucla.edu