1
0
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:
Calvin Rose
2019-12-04 18:36:37 -06:00
parent 8ca10f37bd
commit 2487162ccf
4 changed files with 28 additions and 15 deletions

View File

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