Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

LISP: A dynamic car

Name: Anonymous 2012-01-30 20:27

I have a complex list of lists and want something to check the second element of every list of the list in the loop, any supported features like this?

Name: >>3 2012-01-30 21:33

Oops, wrong paste:

(defun lispify-relations (relation-list)
  (mapcar #'(lambda (x)
          (destructuring-bind (first relation . rest) x
        `(,relation ,first ,@rest)))
      relation-list))

CL-USER> (lispify-relations '((parts lintel post1 post2)
                 (lintel must-be-supported-by post1)
                 (lintel must-be-supported-by post2)
                 (lintel a-kind-of wedge)
                 (post1 a-kind-of brick)
                 (post1 must-not-touch post2)
                 (post2 must-not-touch post1)))
((LINTEL PARTS POST1 POST2) (MUST-BE-SUPPORTED-BY LINTEL POST1)
 (MUST-BE-SUPPORTED-BY LINTEL POST2) (A-KIND-OF LINTEL WEDGE)
 (A-KIND-OF POST1 BRICK) (MUST-NOT-TOUCH POST1 POST2)
 (MUST-NOT-TOUCH POST2 POST1))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List