Help! I loaded a file with a template and a function (see below). CLIPSwin 6.241 doesn't recognize the template (see error message following deffunction). What am I doing wrong?
(deftemplate equation
(field n
(type INTEGER)
(default 0))
(field s
(type STRING)
(default ?NONE)))
(deffunction print-eq-no
(?n)
(printout t (equation (n ?n)) crlf))
A deftemplate is a strictly a data structure. it's not a piece of code that you can call from a function. I'm don't know what it is you're trying to do, but if it's some form of pattern matching you need to use a rule for that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Help! I loaded a file with a template and a function (see below). CLIPSwin 6.241 doesn't recognize the template (see error message following deffunction). What am I doing wrong?
(deftemplate equation
(field n
(type INTEGER)
(default 0))
(field s
(type STRING)
(default ?NONE)))
(deffunction print-eq-no
(?n)
(printout t (equation (n ?n)) crlf))
Defining deftemplate: equation
Defining deffunction: print-eq-no
[EXPRNPSR3] Missing function declaration for equation.
ERROR:
(deffunction MAIN::print-eq-no
(?n)
(printout t (equation
FALSE
CLIPS>
A deftemplate is a strictly a data structure. it's not a piece of code that you can call from a function. I'm don't know what it is you're trying to do, but if it's some form of pattern matching you need to use a rule for that.