[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question on writing a strategy



Hello,

I want to write a strategy that will instantiate a formula in line fnum with
all the values in the range [min max]

i.e. my_strat(1, 3, +) should do 

inst-cp 1 +
inst-cp 2 +
inst 3 +

This seems very easy, but I am having problems incrementing the index.

I define 

(defstep my_strat (&optional min max (fnum +))
   (if (< min max) (then (inst-cp fnum min)(my_strat$ (+ min 1) max fnum))
                    (then (if (eq min max) (inst fnum min)(skip))))
    "instantiate fnum with all values from min to max"
    "instantiate fnum with all values from min to max"
)


Calling (my_strat 0 2) results in

Error: `(+ 0 1)' is not of the expected type `REAL'
  [condition type: TYPE-ERROR]

I do not understand what I am doing wrong with the "+". Please advise.

Thanks,
Tamarah