Menu

CLIPS mistakes template for function

Help
PABlo
2009-09-02
2012-11-23
  • PABlo

    PABlo - 2009-09-02

    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>

     
    • Gary Riley

      Gary Riley - 2009-09-05

      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.

       

Log in to post a comment.