DEFFUNCTION
DEFFUNCTION
With the deffunction construct, new functions may be defined directly in
CLIPS. Deffunctions are equivalent in use to other functions in CLIPS.
The only differences between user-defined external functions and
deffunctions are that deffunctions are written in CLIPS and executed
by CLIPS interpretively and user-defined external functions are written
in an external language, such as C, and executed by CLIPS directly.
Also, deffunctions allow the addition of new functions without having to
recompile and relink CLIPS.
The syntax of the deffunction construct is:
(deffunction <name> [<comment>]
(<regular-parameter>* [<wildcard-parameter>])
<action>*)
<regular-parameter> ::= <single-field-variable>
<wildcard-parameter> ::= <multifield-variable>