All Manuals > KnowledgeWorks and Prolog User Guide > 7 Reference Guide

def-named-kb-class Macro

Summary

Defines a class of named objects for use in the object base.

Package

kw

Signature

def-named-kb-class class-name superclass-list slot-descriptions &rest options => class

Arguments
class-name
A symbol.
superclass-list
A list of symbols.
slot-descriptions
A list of defclass slot descriptions.
options
defclass options.
Values
class
The named class object.
Description

The macro def-named-kb-class defines a new CLOS class name class-name, as defclass does. However, if none of the superclasses in superclass-list is a subclass of named-kb-object, then named-kb-object is added to the list of superclasses. The class inherits a name slot called kb-name, with accessor kb-name and default initialization form (:initform) that generates a symbol from the class name using (gentemp class-name).

slot-descriptions and options are used as in the standard defclass macro.

Examples
(def-named-kb-class vehicle ()
  ((driver :initarg :driver)))
(def-named-kb-class truck (vehicle)
  ((load :accessor truck-load)))
See also

def-kb-class
def-kb-struct
get-kb-object
kb-name
named-kb-object


KnowledgeWorks and Prolog User Guide (Windows version) - 01 Dec 2021 19:36:03