[previous] [up] [next]     [contents] [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 obj) returns the class of the object obj.

(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-extends? v interface) returns #t if v is an interface that extends interface, #f otherwise.

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



PLT