Last active
January 16, 2025 09:06
-
-
Save rmhsilva/46a91bec843db2882ab242d31a8a63ae to your computer and use it in GitHub Desktop.
CLSS-LET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Yay freedom of expression | |
(defmacro clss-let (doc bindings &body body) | |
"Evaluate BODY after selecting tags specified in BINDINGS from DOC | |
BINDINGS should be a list of LET bindings, execept the second element refers | |
to a tag in DOC to be bound to the variable. | |
e.g (clss-let (plump:parse doc-html) | |
((paragraph \"p.foo\") | |
...) | |
(format t (plump:text paragraph)))" | |
(let ((bindings-let (iter | |
(for (var sel) in bindings) | |
(collecting `(,var (clss:select ,sel ,doc)))))) | |
`(let (,@bindings-let) | |
,@body))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment