| Did you know ... | Search Documentation: |
| Predicate get/3 |
get(+Object,
+Message, -Answer)In general, get-behaviour does not modify the object base, with the possible exception of creating new instances that serve as the answer to the query. Send-behaviour is intended to modify the receiving object; nothing in the implementation enforces this, and some get-behaviour has side-effects beyond creating the answer.
The answer of get-behaviour can be an attribute of an object (e.g.
graphical<-area
returns the area object associated with the graphical), or it can be a
freshly created object (e.g.
graphical<-size
returns a new size object reflecting the size of the graphical). The
documentation is the only source for this detail.
Knowing this can be important. For example, modifying the size object
returned by graphical<-size
is valid but does not affect the graphical. Modifying the area returned
by a graphical however will leave the graphical in an incoherent state.
Under normal circumstances, there is no need to ->free the object returned by a get-operation. If the object is not referred to, it will automatically be discarded by the incremental garbage collector once its scope of creation ends.
See also get_class/4, get_super/3, get_object/4 and get_chain/3.