21 lines
586 B
Common Lisp
21 lines
586 B
Common Lisp
(defpackage #:hsx/hsx
|
|
(:use #:cl)
|
|
(:import-from #:hsx/builtin)
|
|
(:export #:hsx))
|
|
(in-package #:hsx/hsx)
|
|
|
|
(defmacro hsx (form)
|
|
(find-builtin-symbols form))
|
|
|
|
(defun find-builtin-symbols (node)
|
|
(if (atom node)
|
|
(or (and (symbolp node)
|
|
(not (keywordp node))
|
|
(find-symbol (string node) :hsx/builtin))
|
|
node)
|
|
(cons (find-builtin-symbols (car node))
|
|
(mapcar (lambda (n)
|
|
(if (listp n)
|
|
(find-builtin-symbols n)
|
|
n))
|
|
(cdr node)))))
|