mirror of
https://github.com/janet-lang/janet
synced 2025-10-23 03:37:40 +00:00
Add top level unquote and macro envs.
This improves macros that eval their arguments and makes them easier to write.
This commit is contained in:
@@ -270,4 +270,11 @@
|
||||
(def nested ~(a ~(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f))
|
||||
(assert (deep= nested '(a ~(b ,(+ 1 2) ,(foo 4 d) e) f)) "nested quasiquote")
|
||||
|
||||
# Top level unquote
|
||||
(defn constantly
|
||||
[]
|
||||
,(math/random))
|
||||
|
||||
(assert (= (constantly) (constantly)) "top level unquote")
|
||||
|
||||
(end-suite)
|
||||
|
Reference in New Issue
Block a user