Page 1 of 1

Making Lisp do Integration

PostPosted: Sun Oct 28, 2018 10:58 am
by Redwine
Hello everyone!

As I've only started coding with Common Lisp 3 weeks ago, I am the novice of novices. I'm presently working on an assignment to make Lisp perform integration (not all forms, mind), but have been running into a problem where my defconstant containing variables throws the error "unbound-variable." Could you take a gander and tell me where I'm going wrong? (only parts of the code listed below)

(defconstant variable-symbols '(U V W X Y Z))

(defun indef-integral (F V)
(cond ((variable-p F)(make-quotient(make-power F 2) 2))
((sum-p F)(make-sum(indef-integral(sum-operand-1 F)V)
(indef-integral(sum-operand-2 F)V)))
((sub-p F)(make-sub(indef-integral(sub-operand-1 F)V)
(indef-integral(sub-operand-1 F)V)))
((power-p F)(make-power(indef-integral(power-operand-1 F)V)
(indef-integral(power-operand-1 F)V)))))

Re: Making Lisp do Integration

PostPosted: Thu Nov 01, 2018 12:56 pm
by David Mullen
Impossible to say, without seeing the rest of the code. What's the purpose of the defconstant?