This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

muLISP to CLISP

4 posts · 2068 views

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.
(defun isMemb? (lList1 lList2)
  (cond  ((null lList1) nil);

;(or (car (member (car lLista1) lLista2 'equal)) (isMemb? (cdr lList1) lList2)));

Re: muLISP to CLISP

**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.
(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

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).
(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

Your code doesn't make sense in any Lisp dialect. Maybe you mean something like this:
(defun isMemb? (lList1 lList2)
  (when lList1
    (or (member  (car lList1) lList2 :test #'equal)
        (isMemb? (cdr lList1) lList2))))