XLISP :class

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# :class

Type: | - | message selector
Source: | - | xlobj.c

## Syntax

(send object :class)
  object - an existing object
  returns the class object

## Description

The ':class' message selector will cause a method to run that will return the object which is the class of the specified 'object'. Note that the returned value is an object which will look like:

    #<Object: #18d8c>

The 'object' must exist or an error will be generated:

    error: bad argument type

## Examples

    (send object :class)                     ; returns the CLASS object
    (send class :class)                      ; returns the CLASS object
    (setq new-cls (send class :new '(var)))  ; create NEW-CLS
    (setq new-obj (send new-cls :new))       ; create NEW-OBJ of NEW-CLS
    (send new-obj :class)                    ; returns the NEW-CLS object
    (send new-cls :class)                    ; returns the CLASS object

See the :class message selector in the XLISP 2.0 manual.

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference