Back Contents Next

15. Odds and Ends

This section covers various corners of the language which weren't explicitly stated.

15.1 ASAP Garbage Collection

BUGBUG write this

15.2 Modifier Ordering

Opal places some restrictions on the order which modifiers can appear before objects. There are three forms of modifiers, they are access modifiers, basic modifiers and name modifiers. The access modifiers are public, protected, scope, private and personal. The basic modifiers are const, final, mutable and abstract. The name modifiers are create, operator, get, get[], set and set[]. An object may only have one if any access modifier and one if any name modifier. The access modifier must come first followed by the basic modifiers and then a name modifier if present.

The order of the basic modifiers if their are more than one is not specified. A recommended order is:

const final mutable abstract

It is suggested that editors provide options to reorder basic modifiers to this order. (Note that no object could ever have all these modifiers)

The keywords class and interface are not modifiers. All modifiers should come before these keywords.

15.3 Pattern Contents

The nature of patterns has been implied throughout this specification but not stated very explicitly. A pattern is an entity which allows objects to be invoked. When a pattern is invoked it creates a new object based on its contents and executes its contents. If a pattern is contained inside another pattern then that pattern is instantiated, that is, the resulting object contains that pattern. If an object is declared in a pattern then that object is created for each invocation of the pattern. In summary, everything in a pattern is recreated for each invocation.

15.4 Tail Calls

Tail calls are method and operator calls which are executed last in a function and whose result is directly returned. It is required that a set of tail calls may be nested to any depth (no stack overflow) in Opal. This can be done by removing items from the stack and directly returning from the called function to the caller. Implementations are also required to consider a value returning call made from a void method call to be a tail call. It is suggested that implementations optimize simple tail recursion into iterative loops.

15.5 Warnings

Ambiguous identifier case warning

Reported when two identfiers are declared in the same scope which differ only in case



Back Contents Next

jwalker@cs.oberlin.edu