5.11 Object, Class, and Interface Utilities
Returns #t if v is an object, #f otherwise.
Returns #t if v is a class, #f otherwise.
Returns #t if v is an interface, #f otherwise.
Returns
#t if
v is a
generic,
#f otherwise.
Determines if two objects are the same object, or not; this procedure uses
eq?, but also works properly with contracts.
Returns a vector representing
object that shows its
inspectable fields, analogous to
struct->vector.
Returns the interface implicitly defined by class.
Returns the interface implicitly defined by the class of
object.
Returns #t if v is an instance of a class
type or a class that implements an interface type,
#f otherwise.
Returns #t if v is a class derived from (or equal
to) class, #f otherwise.
Returns #t if v is a class that implements
interface, #f otherwise.
Returns #t if v is an interface that extends
interface, #f otherwise.
Returns #t if interface (or any of its ancestor
interfaces) includes a member with the name sym, #f
otherwise.
Returns a list of symbols for the method names in interface,
including methods inherited from superinterfaces, but not including
methods whose names are local (i.e., declared with
define-local-member-names).
Returns #t if object has a method named sym
that accepts cnt arguments, #f otherwise.
Returns a list of all of the names of the fields bound in
object, including fields inherited from superinterfaces, but
not including fields whose names are local (i.e., declared with
define-local-member-names).
Returns two values, analogous to the return
values of
struct-info:
class: a class or #f; the result is
#f if the current inspector does not control any class for
which the object is an instance.
skipped?: #f if the first result corresponds
to the most specific class of object, #t
otherwise.
name: the class’s name as a symbol;
field-cnt: the number of fields (public and private)
defined by the class;
field-name-list: a list of symbols corresponding to the
class’s public fields; this list can be larger than field-k
because it includes inherited fields;
field-accessor: an accessor procedure for obtaining
field values in instances of the class; the accessor takes an
instance and a field index between 0 (inclusive)
and field-cnt (exclusive);
field-mutator: a mutator procedure for modifying
field values in instances of the class; the mutator takes an
instance, a field index between 0 (inclusive)
and field-cnt (exclusive), and a new field value;
super-class: a class for the most specific ancestor of
the given class that is controlled by the current inspector,
or #f if no ancestor is controlled by the current
inspector;
skipped?: #f if the sixth result is the most
specific ancestor class, #t otherwise.
Raised for
class-related failures, such as attempting to call
a method that is not supplied by an object.