class-of ( object -- class )
Factor handbook » The language » Objects » Classes

Prev:class? ( object -- ? )
Next:instance? ( object class -- ? )


Vocabulary
classes

Inputs
objectan object


Outputs
classa class


Word description
Outputs an object's canonical class. While an object may be an instance of more than one class, the canonical class is either its built-in class, or if the object is a tuple, its tuple class.

Examples
USING: classes prettyprint ; 1.0 class-of .
float

USING: classes prettyprint ; IN: scratchpad TUPLE: point x y z ; T{ point f 1 2 3 } class-of .
point


Definition

GENERIC: class-of ( object -- class )


Methods