[previous] [up] [next]     [index]
Next: Units Up: Classes and Objects Previous: Generic Procedures

Object Utilities

(object? v) returns #t if v is a object, #f otherwise.

(class? v) returns #t if v is a class, #f otherwise.

(interface? v) returns #t if v is an interface, #f otherwise.

(object-class object) returns the class of object.

(is-a? v class) returns #t if v is an instance of class (or of a class derived from class), #f otherwise.

(is-a? v interface) returns #t if v is an instance of a class that implements interface, #f otherwise.

(subclass? v class) returns #t if v is a class derived from (or equal to) class, #f otherwise.

(implementation? v interface) returns #t if v is a class that implements interface, #f otherwise.

(interface-extension? v interface) returns #t if v is an interface that extends interface, #f otherwise.

(ivar-in-class? symbol class) returns #t if class (or any of its ancestor classes) defines an instance variable with the (external) name symbol, #f otherwise.

(ivar-in-interface? symbol interface) returns #t if interface (or any of its ancestor interfaces) defines an instance variable with the name symbol, #f otherwise.



PLT