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)))))
Making Lisp do Integration
Forum rules
Please respect your teacher's guidelines. Homework is a learning tool. If we just post answers, we aren't actually helping. When you post questions, be sure to show what you have tried or what you don't understand.
Please respect your teacher's guidelines. Homework is a learning tool. If we just post answers, we aren't actually helping. When you post questions, be sure to show what you have tried or what you don't understand.
-
- Posts: 78
- Joined: Mon Dec 01, 2014 12:29 pm
- Contact:
Re: Making Lisp do Integration
Impossible to say, without seeing the rest of the code. What's the purpose of the defconstant?