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.

`(class->interface class)` returns the interface implicitly defined by class.

`(object-interface object)` returns the interface implicitly defined by the class of object.

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

`(is-a? v class)` returns `#t` if v is an instance of class (or of a class derived from class), `#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-interface? symbol interface)` returns `#t` if interface (or any of its ancestor interfaces) defines an instance variable with the name symbol, `#f` otherwise.

`(interface->ivar-names interface)` returns a list of symbols for the instance variable names in interface (including instance variables inherited from superinterfaces).

`(class-initialization-arity class)` returns a value specifying the number of initialization arguments that are accepted when creating an instance of class. See `arity` in section 4.10.1 for information about arity values.