Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Add var# tag
Browse files Browse the repository at this point in the history
TODO: document/doctest
gilch committed Oct 29, 2024
1 parent a793128 commit 889a4d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/hissp/macros.lissp
Original file line number Diff line number Diff line change
@@ -461,7 +461,7 @@ See `hissp.macros`.
(let (form `(setattr (.get (globals) "_macro_")
',name
(fun ,(.format "_macro_.{}" name) ,parameters ,@body)))
(if-else (operator..contains (.get hissp.compiler..ENV) '_macro_)
(if-else (operator..contains (.get hissp..*env*) '_macro_)
form
`(progn (.setdefault (globals) "_macro_" (types..SimpleNamespace))
,form)))))
@@ -2707,6 +2707,12 @@ See `hissp.macros`.
`(lambda (: :* $#xs)
(ft#reduce ,f $#xs)))

(defmacro var\# f
"makes function arguments reloadable"
`(ft#update_wrapper (lambda (: :* $#args :** $#kwargs)
(,f : :* $#args :** $#kwargs))
,f))

;;;; Collection

(defmacro @ (: :* xs)

0 comments on commit 889a4d3

Please sign in to comment.