Formatting a list
问题 I have the following list: (X X O NIL NIL O NIL NIL O) I'd like to format it to look like this: X | X | O --+---+-- | | O --+---+-- | | O I could probably cobble something together with what little I know about Lisp and FORMAT , but it would probably be pretty gross. Any pointers would be greatly appreciated. 回答1: * (format t "~{~A | ~A | ~A~%~^--+---+--~%~}" (mapcar (lambda (x) (or x " ")) '(X O X NIL X X O X NIL))) X | O | X --+---+-- | X | X --+---+-- O | X | NIL 回答2: * (format t "~{~A |