Implementing the Extended Return Statement for Ada 2005 S. Tucker Taft SofCheck, Inc. 11 Cypress Drive Burlington, MA 01803 +1-781-750-8068 tucker.taft@sofcheck.com ABSTRACT Ada 2005 adds an important capability to the language by allowing the construction and return of an object of a limited type by a function. New syntax for an extended return statement was added to enhance this capability further. This capability to return newly constructed objects of a limited type from a function, when combined with the additional capability to use aggregates to construct objects of a limited type, goes a long way to making use of limited types far more friendly and effective. Although the extended return statement and the associated ability to construct and return objects of a limited type brings new power to Ada, it also brings new choices and challenges to the Ada compiler implementor, when trying to decide how best to implement this feature. This presentation will review some of these alternatives, and present a high-level description of one particular approach based on the notion of an object creation context (OCC) which is designed to minimize the complexity of the generated code while providing an efficient and flexible implementation. effectively an
/lp/association-for-computing-machinery/implementing-the-extended-return-statement-for-ada-2005-FhQG1CAqt2