One may in some cases want an object to contain a reference ( 'Access ) to itself.

The package Self_Referencing_Objects shows how one can implement (consistently) self-referencing objects using limited records and discriminants.

type Instance is limited private ; ... type Holder ( Reference : access Instance ) is limited null record ; type Instance is limited record Self : Holder ( Instance ' Access ); ... end record ;

Notice how Self.Reference is initialised with the access value of the containing Instance object using Instance'Access .

The first declaration of type Instance could also be a forward type declaration:

type Instance ;