### Making Lisp do Integration

Posted:

**Sun Oct 28, 2018 10:58 am**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)))))

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)))))