CommonUser
November 14th, 2008, 03:26 AM
I have a few questions about lisp. First, is there any way I can save a file as "sometext.lisp" and go to terminal type in a command to interpret whatever is written in that text file? As of now I am typing out everything each time.
Second, I'm trying to work with loops, if statements and variables but I can't seem to get it working.
(defvar *x* 0)
(defun foo(element list)
(loop for i from 0 to (length list)
do (if (= element (nth i list) (incf *x*) nil)
)
)
Thanks for your help.
Second, I'm trying to work with loops, if statements and variables but I can't seem to get it working.
(defvar *x* 0)
(defun foo(element list)
(loop for i from 0 to (length list)
do (if (= element (nth i list) (incf *x*) nil)
)
)
Thanks for your help.