Lecture 17 – October 24th

I need your folders with your linked list queue implementations and test programs in a folder today. The folder should contain your specification, your body, your test program, screen capture of the running of your test program.

 

Let’s look at page 276 – Specification for a generic bounded stack

 

Differences between our specification and text specification

  • No tagged type
  • Different procedure and function names

 

Note explanation of limited private type found on next page (p. 277)

 

 From:          http://www.adahome.com/LRM/95/rm95html/rm9x-07-03.html#1

The declaration (in the visible part of a package) of a type as a private type … serves to separate the characteristics that can be used directly by outside program units (that is, the logical properties) from other characteristics whose direct use is confined to the package (the details of the definition of the type itself)... A private type is limited if its declaration includes the reserved word limited;

Examples of private type declarations:

(22)
       type Key is private;
       type File_Name is limited private;
 
 
Information about PRIVATE and LIMITED PRIVATE types from Ada An Advanced Introduction by Narain Gehani, Prentice-Hall,198, p.103.
the implementation details of types declared in a package specification may be hidden from the user of the pacage by designating the types to be private. A type is designated as private by associating with it either the attribute private or the attribute limited private.   A private type is declared using a private type declaration given in the visible part of a package specification.  [as in above example from the LRM].    The full type declaration is given later in the private part of a package specification instead of the package body.  The full type declaration is given in the package specification itself to ensure that the specification contains sufficient information to allow the compilation of a unit using the package. [we did something similar way back in usefulStuff.ads]  
Objects of private types can be:
            Declared
            Passed as parameters
            Compared for equality and inequality 
            Assigned values of other objects of the same type
Objects of limited private types only be
            Declared
            Passed as parameters
 
Prepare for Thursday’s Exam
·        Stuff in red in all lectures emphasizes important material.  You are responsible for everything in all lectures 
·        Bring your Ada sheet (referenced in Lecture 2) to the exam.  Not sure if you can use it, but bring it just in case.
·        How to study for exam
o       Review lecture notes            
o       Review sample programs
o       Review your code
o       Read the pages in the book that 
§         are referenced explicitly in a lecture
§         refer to material referred to in lectures
o       Look online for clarification of language features
o       Go through the book’s index, highlighting the terms we’ve covered.