hsx/src/hsx.lisp
2024-06-01 10:34:36 +09:00

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)))))