Chapter 11

The Built-In Classes

Objects

<object> [Open Abstract Class]


The class of all Dylan objects.

Superclasses:

None. <object> is the root of the Dylan class hierarchy.

Init-keywords:

None.

Description:

The class <object> is the root of the type system. All objects are general instances of <object>, all types are subtypes of <object>, and all classes are subclasses of <object>.

Operations:

The class <object> provides the following operations:

Table 11-1 Functions on <object>

Function

Description

Page

identity

Returns its argument.

287

always

Returns a function that always returns a particular object.

350

instance?

Tests whether an object is an instance of a type.

343

object-class

Returns the class of an object.

344

==

Compares two objects for identity.

268

~==

Compares two objects for nonidentity.

269

~

Returns true if its argument is false; otherwise returns false.

268

object-hash

The hash function for the equivalence predicate ==.

342

Table 11-2 Generic functions on <object>

Function

Description

Page

initialize

Performs instance initialization that cannot be specified declaratively by a class definition.

260

as

Coerces an object to a type.

288

shallow-copy

Returns a copy of its argument.

292

type-for-copy

Returns an appropriate type for creating mutable copies of its argument.

292

size

Returns the size of its argument.

295

empty?

Returns true if its argument is empty.

294

Table 11-3 Methods on <object>

Function

Description

Page

initialize

Performs instance initialization that cannot be specified declaratively by a class definition.

260

type-for-copy

Returns an appropriate type for creating mutable copies of its argument.

292

=

Compares two objects for equality.

269