ToC DocOverview CGDoc RelNotes Index PermutedIndex
Allegro CL
Home Previous Up Next Table of Contents Index
  ANSI Common Lisp   7 Objects   7.7 Dictionary of Objects

7.7.39 class-of Function

Syntax:
class-of object    class

Arguments and Values:
object - an object.

class - a class object.

Description:
Returns the class of which the object is a direct instance.

Examples:
 (class-of 'fred)  #<BUILT-IN-CLASS SYMBOL 610327300>
 (class-of 2/3)  #<BUILT-IN-CLASS RATIO 610326642>
 
 (defclass book () ())  #<STANDARD-CLASS BOOK 33424745>
 (class-of (make-instance 'book))  #<STANDARD-CLASS BOOK 33424745>
 
 (defclass novel (book) ())  #<STANDARD-CLASS NOVEL 33424764>
 (class-of (make-instance 'novel))  #<STANDARD-CLASS NOVEL 33424764>

 (defstruct kons kar kdr)   KONS
 (class-of (make-kons :kar 3 :kdr 4))  #<STRUCTURE-CLASS KONS 250020317>

See Also:
make-instance, type-of

Allegro CL Implementation Details:
None.

Home Previous Up Next Table of Contents Index
© Franz Inc. 1998-2019 - File last updated 02-07-2019