Actually the error message is pretty clear, I think; there's no function named price
, but the expression (price ?product ?price)
is interpreted as a call to a function by that name.
I understand what you want getTotalPrice
to do, but I can't understand your implementation; I think you're mistaken about what the apply
function does -- maybe you're confusing it with a similarly named function in some other language.
Anyway, the way to write getTotalPrice
in Jess would be by using a query; see here to learn about those.