KnowledgeWorks and Prolog User Guide > 4 Objects > 4.1 CLOS objects

NextPrevUpTopContentsIndex

4.1.2 Named Classes

A named KnowledgeWorks CLOS class is defined by the macro def-named-kb-class which is syntactically identical to the Common Lisp defclass macro, and semantically identical with the exception that it adds a KnowledgeWorks mixin class named-kb-object if none of the superclasses already contains it, and makes the default name for the objects be a symbol generated from the class name. Classes defined by def-named-kb-class contain a name slot which those defined by def-kb-class do not.

The function make-instance can be given the initialization argument :kb-name to specify a name. If not specified, a default name is generated from the name of the class. All names must be distinct as regarded by eq . The function

(get-kb-object <name>)

retrieves the instance from its name. The function

(kb-name <object>)

returns the name of the given object.

4.1.2.1 Examples


KnowledgeWorks and Prolog User Guide (Windows version) - 22 Dec 2009

NextPrevUpTopContentsIndex