#self-reference Articles


Self-referencing Objects

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 ...