Problem in COND
Posted: Mon Jun 25, 2012 6:20 am
Hi,
I am quit new in lisp programming. I wrote a simple program but It gives me an error when I try to run it.
I think the problem is the way that I call the function but I don't know how to solve it.
I want to have something like switch case in lisp. And this is my program:
(defun test (var)
(cond
((= var "foo")
(message "This is the foo block."))
((= var "bar")
(message "This is the bar block."))
(t
(message "Default case")
)))
(test ("foo"))
Anybody can help?
Thank you.
I am quit new in lisp programming. I wrote a simple program but It gives me an error when I try to run it.
I think the problem is the way that I call the function but I don't know how to solve it.
I want to have something like switch case in lisp. And this is my program:
(defun test (var)
(cond
((= var "foo")
(message "This is the foo block."))
((= var "bar")
(message "This is the bar block."))
(t
(message "Default case")
)))
(test ("foo"))
Anybody can help?
Thank you.