Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun gen-html-tag (form environment)
- (destructuring-bind (tag &rest body) form
- `(progn (format t "<~A>" ',tag)
- ,@body
- (format t "</~A>" ',tag))))
- (setf (macro-function 'a) (function gen-html-tag)
- (macro-function 'p) (function gen-html-tag)
- #| …the whole html…|#)
- (with-output-to-string (*standard-output*)
- (p (princ "foo")
- (a (princ "link"))
- (princ "bar")))
- #| --> "<p>foo<a>link</a>bar</p>" |#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement