Name

defclass

Usage

macro

Syntax

(defclass name [doc-string] prototype-object)

Creates predicate, constructor and accessor functions for the given prototype object.

user 1 > (macroexpand '(defclass person #s(name "" address "" city "")))
it: (do
        (deftype person #s(:address "" :city "" :name ""))
        (defun person? (obj)
            (type? obj 'person))
        (defun make-person (&rest args)
            (apply prototype:new 'person args))
        (defun person-name (obj)
            (.name obj))
        (define-compiler-macro person-name (obj)
            (bq:list (bq:list (bq:quote .) (bq:force "name")) (bq:force obj)))
        (defun person-address (obj)
            (.address obj))
        (define-compiler-macro person-address (obj)
            (bq:list (bq:list (bq:quote .) (bq:force "address")) (bq:force obj)))
        (defun person-city (obj)
            (.city obj))
        (define-compiler-macro person-city (obj)
            (bq:list (bq:list (bq:quote .) (bq:force "city")) (bq:force obj)))
        'person)