(rontolisp) docs
← cl Package Functions

class-of

(class-of object)

Returns the class METAOBJECT of any value -- the same memoized object find-class answers, so (eq (class-of x) (find-class 'name)) holds. A CLOS instance answers its class, a defstruct instance its structure type (a standard-class instance -- there is no structure-class), and every other value a slot-less built-in class, an instance of built-in-class, named integer, string, cons, ..., with t for values outside that set. An array answers the narrowest built-in class that covers it: string for a string, vector for any other rank-1 array, array above and below that rank. A built-in stream answers the slot-less class of the standard name type-of gives it (string-stream, two-way-stream, ..., stream), and a pathname, a readtable and a random-state the class of that name. Read the name with class-name; type-of is a different, finer view and is unaffected.