Defines a structure class for use in the object base.
kw
def-kb-struct name-and-options {slot-description}* => name
name-and-options ::= name | (name {option}*)
option ::= (:include superclass) | (:print-function print-function)
slot-description⇩ |
A defstruct slot description. |
name⇩ |
A symbol. |
superclass⇩ |
A symbol. |
print-function⇩ |
A symbol or a lambda expression. |
name |
The name of the structure class. |
The macro def-kb-struct
defines a KnowledgeWorks structure class name name. Objects of these classes are analogous to Lisp structures except that they may be used in rules similarly to CLOS objects.
If superclass is supplied then name will inherit from superclass, which must be KnowledgeWorks structure class.
print-function and slot-description are used as in defstruct.
(def-kb-struct start) (def-kb-struct (named-kb-struct (:print-function print-named-kb-struct)) (name (gensym 'named-kb-struct)))
(def-kb-struct (possible-trucks-for-load (:include named-kb-struct)) load trucks)
KnowledgeWorks and Prolog User Guide (Windows version) - 01 Dec 2021 19:36:03