hsx/src/hsx.lisp

22 lines
586 B
Common Lisp
Raw Normal View History

2024-05-28 11:15:29 +00:00
(defpackage #:hsx/hsx
2024-05-25 16:26:26 +00:00
(:use #:cl)
2024-06-01 01:34:36 +00:00
(:import-from #:hsx/builtin)
(:export #:hsx))
2024-05-25 16:26:26 +00:00
(in-package #:hsx/hsx)
2024-05-31 22:22:01 +00:00
(defmacro hsx (form)
(find-builtin-symbols form))
2024-05-26 10:48:09 +00:00
2024-05-27 10:11:27 +00:00
(defun find-builtin-symbols (node)
(if (atom node)
(or (and (symbolp node)
(not (keywordp node))
(find-symbol (string node) :hsx/builtin))
2024-05-27 10:11:27 +00:00
node)
(cons (find-builtin-symbols (car node))
(mapcar (lambda (n)
(if (listp n)
(find-builtin-symbols n)
n))
(cdr node)))))