This is a list of topics for review.
- Basic Syntax.
- Rules for forming identifiers.
- How to make control statements (loop, while, for).
- Data Types.
- Creating user types.
- New types versus subtypes.
- Name equivalence.
- Enumerated types.
- Creating types and variables.
- Creating subranges.
- Attributes: Succ, Pos, Val, etc.
- Overloading enumerate identifiers.
- Character and boolean.
- Arrays types.
- Creating variables and types.
- The attributes first, last, and length.
- Slices.
- Rules for assigning arrays and slices.
- Arrays of arrays versus multi-dimensional arrays.
- Creating array aggregates.
- Know what constrained and unconstrained types are, and what
you can do with each.
- Strings.
- Access types.
- Dangling pointers are bad.
- Pool-specific: Creation and limitations.
- All pointers.
- The reference attribute and the aliased declaration.
- Accessibility rules.
- Access parameters.
- Subprogram access types.
- Records.
- Functions and procedures.
- Declaration syntax.
- Parameter types and rules for sending parameters.
- Use of unconstrained array parameter types.
- In, out, and in out parameters.
- Default and keyword parameters.
- Packages.
- Know how to specify a package and a package body.
- Know the differences and similarities between a package and a class.
- Know that packages can be used to declare one or more types,
but they are not themselves types.
- Know what a private type is and how to create one.
- Know what the private section of a package is, and what goes there.
- Know how to overload
=
.
- Know what limited types are, what they do, and why you might
want one.
- Child Packages.
- How to declare one.
- What privileges a child package has compared to packages which are
not children of the same parent.
- Know what a private child unit is, and why you would want one.
- Know what
separate
functions are, and how to declare one.
- Know how to use renaming.
- Object-Oriented Programming
- Understand how Ada uses external notation:
f(obj,y)
instead of
Java-style obj.f(y)
.
- Understand in what sense methods belong to object types.
- Know what type extension is and does.
- The syntax is
type
d is new
b with ... ;
- This creates a type
d
derived from b
- Know how type hierarchies are created in Ada.
- Polymorphism.
- Know what the
tagged
modifier does. Know the difference between
the tagged and un-tagged versions of a type.
- Know what the
'class
attribute means, and know what the difference
is between procedure P(f: Fred);
and
procedure P(f: Fred'class);
.
- Know the rules for conversions (casting) up and down a tree.
(Hint: Pretty much just like Java.)
- Be able to tell if a call is dispatching or not.
Understand the example calls on pp. 284 and 285.
- If a call is dispatching, be able to tell what function or procedure
is called.
- Know how to declare abstract types. Know why an abstract type
is generally tagged.
- Know how to declare a controlled type.
- Exceptions.
- Know what exceptions are, and what they are used for.
- Know how how to catch an exception.
Know the syntax and semantics of
exception
clause.
- Know how to raise an exception.
Know the syntax and semantics of
raise
statement.
- Know how to declare exceptions.
- Know that an exception handler cannot return to the point
of the exception.
- Generics
- Know how to create a parametric type, as in
the linked list of strings example.
- Know how to create a record with a variant part,
as in the variant example.
- Know the rules about declaring variables of a parameterized type.
- An ordinary variable may not have a parameterized type
unless it is constrained (a value is given for the type parameter).
- A function or procedure parameter may have an unconstrained
parameterized type.
- You may create pointers to unconstrained parameterized types as well.
- Know how to create generic packages as
in the stack example.
- Know how to use a generic package.
- Know about generic packages generally:
- Understand why generic packages are useful.
- Know the differences between implementing a
generalized ADT using inheritance or using a
generic package.