Plaster
New
List
Login
common-lisp
default
anonymous
2019.10.12 02:14:43
CL-USER> (defun sexp-to-html (sexp) (format t "<~A>" (first sexp)) (mapcar (lambda (s) (cond ((listp s) (sexp-to-html s)) ((symbolp s) (format t "~A=" s)) (t (format t "'~A'" s)))) (rest sexp)) (format t "</~A>" (first sexp))) WARNING: redefining COMMON-LISP-USER::SEXP-TO-HTML in DEFUN SEXP-TO-HTML CL-USER> (sexp-to-html '(ul (li "ree") (li "ree"))) <UL><LI>'ree'</LI><LI>'ree'</LI></UL> NIL
Raw
Annotate
Repaste
Edit