I'm learning lisp by myself and I can′t figure out why am I getting this error. If somebody could help me that would be great :)
This is the condition where I'm getting the error:
(cond ((equal c1 caracter) (push caracter pilatemp))
((or (equal c2 caracter) (equal c3 caracter) (equal c4 caracter) (equal c5 caracter) (equal c6 caracter))
((loop
(setf t1 (jerarquia(caracter)))
(setf t2 (jerarquia(first pilatemp)))
if((or (= t1 t2) (> t1 t2)) (return))
(push (pop pilatemp) piladef))
(push caracter pilatemp)
))
((equal c7 caracter) ((loop
if((equal (first pila) c1) (return))
(push (pop pilatemp) piladef))
(pop pilatemp)))
(T (push caracter piladef))
)
And here is the "jerarquia" function:
(defun jerarquia(x)
(setf c1 ")")
(setf c2 "+")
(setf c3 "-")
(setf c4 "^")
(setf c5 "*")
(setf c6 "/")
(setf c7 "(")
(cond ((equal c1 x) 5)
((equal c4 x) 4)
((equal c5 x) 3)
((equal c2 x) 2)
((equal c7 x) 1)
(T 0)))
Here's the error I'm getting:
*** - SYSTEM::%EXPAND-FORM:
(LOOP (SETF T1 (JERARQUIA (CARACTER)))
(SETF T2 (JERARQUIA (FIRST PILATEMP))) IF
((OR (= T1 T2) (> T1 T2)) (RETURN)) (PUSH (POP PILATEMP) PILADEF))
should be lambda expression
See Question&Answers more detail:os