Summary of ALIOOOP Group
Ada Linguists Interested Only in OOP

Session Leader: Tucker Taft

Scribe: Martin Carlisle

Attendance: 17

The session was organized as a discussion to provide feedback on several proposals to enhance the object-oriented features of Ada 95.

  1. Object.Method notation

    Discussion: Some felt this was a "harmless" addition which served only an "advertising purpose". Others felt this made it easier to use Ada in combination with other OO languages (such as Java or C#), and also that this reduced a verbosity problem, and the pressure for use clauses. The current proposal requires the controlling parameter appear first to use object.method syntax. Some wondering about if people have the controlling parameter not first, but it seemed generally agreed that if they wanted to use the new syntax they could change. Important to retain support for old syntax-- some wanted pragma requiring use of old (or new) syntax, e.g. pragma Restriction (No_Method_Prefix_Notation);.

    In favor : 13
    Opposed : 1
    Neutral/no vote: 3

    1b. Using Object.Method notation for classwide (non-dispatching methods). Can be done in Java, C++, not C#

    In favor : 1
    Opposed : 2
    Neutral/no vote: 14

    1c. Using Object.Method for non-tagged composite types

    In favor : 0
    Opposed : 5
    Neutral/no vote: 12

    It was noted that this has been implemented in GNAT (not 1b or 1c) with only 127 lines by Martin Carlisle, and Tucker Taft encouraged experimentation with implementations of the proposals.

  2. Interfaces

    Discussion: As in C# or Java. Java uses some as boolean flags (e.g. Cloneable, Serializable), but Ada would use pragma or attribute. No plan for standardized interfaces, just the ability to create them.

    In favor : 15
    Opposed : 0
    Neutral/no vote: 2
  3. Type stub

    type Employee is tagged separate in Workers;

    Discussion: To resolve problem of mutually dependent types in multiple package. Biggest problem is that there is nothing in the context clause. 5 participants felt it was important to have something appear in the context clause. The problem with GNAT's "with type" was mentioned, and had something to do with compiler implementation difficulties.

    3a. Resolve circularity?

    In favor : 13
    Opposed : 0
    Neutral/no vote: 4

    3b. If so, do we solve problem of many packages with same named type? E.g. type Class1_Typ is tagged separate Class1.Typ

    Unanimously in favor
  4. Anonymous access types

    Discussion: When modeling a hierarchy, sometime have to cast up to the parent ptr. Should we provide a mechanism to remove type-casts for conversions that are guaranteed to be safe?

    In favor : 11
    Opposed : 0
    Neutral/no vote: 6
  5. Make limited types less limited

    Discussion: Aggregate assignment is a good safety feature in Ada, as it ensures that all fields of a record are initialized. This can not be used with limited types. Should this be allowed for initialization only? (Must add <> [box] syntax for tasks and other things for which the "default" behavior is desired/required).

    In favor : 8
    Opposed : 0
    Neutral/no vote: 9

    5b. Assuming aggregate assignment is allowed, should we allow functions to return limited types for initialization only? E.g. X : Limited_Type1 := Initialize(3,4);

    In favor : 6
    Opposed : 0
    Neutral/no vote: 11
  6. Assertion pragmas

    Discussion: pragma Assert is not controversial. Should some sort of dynamic pre/post conditions be added?

    Yes: 5 -- allows run-time checks that are user specified
    No: 2 -- because a run-time thing, may require functions not otherwise used. Might standardize something that is immature?
  7. Unintialized variables

    Discussion: Java does not allow local variables to be used before initialized. Should a pragma be added that requires initialization on all paths? (e.g. pragma Require_Initialization;). Closes a safety hole in Ada-- only enforced to the same degree as in Java

    In favor : 14
    Opposed : 0
    Neutral/no vote: 3
  8. Modeling physical units

    Discussion: There was limited discussion of adding a compile-time feature for ensuring that units of mass,length,time were combined appropriately, as subtypes of the same type.

Relative importance of proposals

Proposal\Importance   High Medium  Low
Object.Method           8     4     3
Type stub               9     5     0
Interfaces             13     2     0
Anonymous access types  0     9     6
Limited types aggr.     0     8     4
Limited func ret*       5     4     4
Unintialized vars      11     3     0

*only if limited types aggr is done