Page 1 of 1
muLISP to CLISP
Posted: Tue Jun 14, 2011 2:06 pm
by csphysics27
program written in muLisp trying to conver to clisp. everything seems to be correct maybe someone can guide me in the right way regarding this function. thanks in advance.
Code: Select all
(defun isMemb? (lList1 lList2)
(cond ((null lList1) nil);
;(or (car (member (car lLista1) lLista2 'equal)) (isMemb? (cdr lList1) lList2)));
Re: muLISP to CLISP
Posted: Tue Jun 14, 2011 2:54 pm
by csphysics27
**Updated code**
Ive got a successful load running "(isMemb? '(a (b g) c) '(n h (b g)) );", though now an error comes up "*** - MEMBER: keyword arguments in (EQUAL) should occur pairwise"
Maybe something is incorrect with the equal in my code, help is appreciated. thank you.
Code: Select all
(defun isMemb? (lList1 lList2)
(cond ((null lList1) nil)
);*** null
(or (car (member (car lList1) lList2 'equal)) (isMemb? (cdr lList1)lList2)));*** defun isMemb?
Re: muLISP to CLISP
Posted: Tue Jun 14, 2011 7:24 pm
by nuntius
The new code still doesn't look right. Copied here with more reasonable indentation (lisp programmers tend to use vertical space a bit more freely).
Code: Select all
(defun isMemb? (lList1 lList2)
(cond ((null lList1) nil))
(or (car (member (car lList1) lList2 'equal))
(isMemb? (cdr lList1) lList2)))
Note that the COND form has no effect. The call to
MEMBER is missing the :test argument.
Re: muLISP to CLISP
Posted: Wed Jun 15, 2011 9:05 am
by Konfusius
Your code doesn't make sense in any Lisp dialect. Maybe you mean something like this:
Code: Select all
(defun isMemb? (lList1 lList2)
(when lList1
(or (member (car lList1) lList2 :test #'equal)
(isMemb? (cdr lList1) lList2))))