Page 1 of 1

Should be a lambda expression

Posted: Sat May 26, 2012 3:01 pm
by Hexoblade
Here is the function causing problems:

Code: Select all

(defun equalprev (x y)
     (cond
         ((or (atom x) (atom y)) 
         	 (if (not(null isLoop)) 
         	 	 t 
         	 	 ((setq list1 (append list1 (list x))) (setq list2 (append list2 (list y))) (eql x y))
         	  )
         )
         ((equalprev (car x) (car y)) 
      	         (equalprev (cdr x) (cdr y))
      	 )
   )    
)

ERROR:

*** - SYSTEM::%EXPAND-FORM: (SETQ LIST1 APPEND LIST1 LIST X) should be a lambda expression
The following restarts are available:
ABORT :R1 Abort main loop

Re: Should be a lambda expression

Posted: Sun May 27, 2012 8:14 am
by nuntius
(please write a bit more about what you are doing)

The error message is complaining about the ((setq ...)) form. The first thing after the opening parenthesis generally gets evaluated as a function; but (setq ...) isn't a function form. So get rid of one set of parens and this error will go away. If you need the parens to do multiple things, try (progn (thing1) (thing2)).