interface Handle<Filesystem<>> is function Create_Handle( FS : ref var Filesystem; Name : String) -> Handle; operator "end"(Obj : ref var Handle); ... end interface Handle;The compiler inserts a call on the "end" operator automatically at the end of the scope of an object. The compiler ensures that "end" is called no matter how the scope comes to an end. If an object is allocated from a region, then the "end" operator is invoked on the object immediately prior to deallocating the region. If an object has a value and is then assigned a completely new value, the "end" operator, if any, for its type is applied to the object prior to assigning it the new value.
In a composite object, the "end" operator is invoked on the enclosing object before invoking it on the component objects, so that the "end" operator of the enclosing object may safely refer to its components.
No comments:
Post a Comment