Should be a lambda expression

Discussion of Common Lisp

Should be a lambda expression

Postby Hexoblade » Sat May 26, 2012 3:01 pm

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
Last edited by nuntius on Sun May 27, 2012 8:15 am, edited 1 time in total.
Reason: add code tag
Hexoblade
 
Posts: 1
Joined: Sat May 26, 2012 2:58 pm

Re: Should be a lambda expression

Postby nuntius » Sun May 27, 2012 8:14 am

(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)).
User avatar
nuntius
 
Posts: 498
Joined: Sat Aug 09, 2008 10:44 am
Location: Burlington, MA


Return to Common Lisp

Who is online

Users browsing this forum: Yahoo [Bot] and 13 guests

cron