Download ciao Reference Manual - pdf

Transcript
Chapter 109: Run time usage of objects
463
− The following properties should hold at call time:
Instance is an unique term which identifies an object.
(objects_rt:instance_
id/1)
Class is a free variable.
(term_typing:var/1)
− The following properties should hold upon exit:
Class is an atom denoting a class.
(objects_rt:class_name/1)
derived from/2:
PREDICATE
Test whether an object identifier was derived directly from a class, by the usage of new/2
or a static instance declaration ( instance_of/2).
Usage 1: derived_from(Instance, Class)
− Description: Test derivation of Instance from Class
− The following properties should hold at call time:
Instance is an unique term which identifies an object.
(objects_rt:instance_
id/1)
Class is an atom denoting a class.
(objects_rt:class_name/1)
Usage 2: derived_from(Instance, Class)
− Description: Retrieves the Class responsable of the derivation of Instance.
− The following properties should hold at call time:
Instance is an unique term which identifies an object.
(objects_rt:instance_
id/1)
Class is a free variable.
(term_typing:var/1)
− The following properties should hold upon exit:
Class is an atom denoting a class.
(objects_rt:class_name/1)
interface/2:
PREDICATE
This predicate is used to ensure a given interface to be implemented by a given instance.
Usage 1: interface(Instance, Interface)
− Description: Check whether Instance implements the given Interface.
− The following properties should hold at call time:
Instance is an unique term which identifies an object.
(objects_rt:instance_
id/1)
Interface is an unique atom which identifies a public interface.
(objects_
rt:interface_name/1)
Usage 2: interface(Instance, Interfaces)
− Description: Retrieves on backtracking all the implemented Interfaces of Instance.
− The following properties should hold at call time:
Instance is an unique term which identifies an object.
(objects_rt:instance_
id/1)
Interfaces is a free variable.
(term_typing:var/1)
− The following properties should hold upon exit:
Interfaces is an unique atom which identifies a public interface.
(objects_
rt:interface_name/1)