Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro $ (selector-or-nodes &rest modifiers)
- (if (not selector-or-nodes)
- `*CREAM-MASTER-DOCUMENT*
- `(let ((working-nodes *CREAM-MASTER-DOCUMENT*))
- ,(if (stringp selector-or-nodes)
- `(setf working-nodes (css:query ,selector-or-nodes working-nodes))
- `(setf working-nodes ,selector-or-nodes))
- (if (not (listp working-nodes))
- (setf working-nodes (list working-nodes)))
- ,(if modifiers
- `(progn
- ,@(loop for mod in modifiers collect
- `(setf working-nodes (loop for node in working-nodes collect
- (,(car mod) node ,@(cdr mod)))))))
- working-nodes)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement