Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro* defrule (name (input-parameter &rest other-parameters) &rest body)
- `(defun ,(intern (format "parse-%s" name)) ,(cons input-parameter other-parameters)
- (unless (zerop (length ,input-parameter))
- ,@body)))
- (macroexpand-1 '(defrule ordinary (input)
- (list (substring input 1 nil) (list 'literal (aref input 0)))))
- --> (defun parse-ordinary (input) (unless (zerop (length input)) (list (substring input 1 nil) (list (quote literal) (aref input 0)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement