summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-11-02 20:41:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-11-02 20:41:28 -0700
commit167ae958a8a4376703ade38a8f9c56763e3626f3 (patch)
tree02dc2e12ff4dbdc6a986c8e1688f838443713754 /tests
parentafb21018f168e886552f460834ba393c083f80ee (diff)
downloadtxr-167ae958a8a4376703ade38a8f9c56763e3626f3.tar.gz
txr-167ae958a8a4376703ade38a8f9c56763e3626f3.tar.bz2
txr-167ae958a8a4376703ade38a8f9c56763e3626f3.zip
The code expander becomes a public API.
The functions sys:expand, sys:expand* and sys:expand-with-free-refs are now in the usr package and documented for public use. * eval.c (eval_init): Move registrations of the symbools expand, expand* and expand-with-free-refs from the system package to the user package. * share/txr/stdlib/awk.tl (sys:awk-mac-let, awk): Uses of sys:expand drop the sys: prefix. * share/txr/stdlib/op.tl (sys:op-alpha-rename): Likewise. * share/txr/stdlib/place.tl (call-upudate-expander, call-clobber-expander, call-delete-expander, sys:placelet-1): Likewise. * tests/011/macros-2.txr, tests/012/struct.tl: Likewise. * txr.1: Documented expand, expand* and expand-with-free-refs.
Diffstat (limited to 'tests')
-rw-r--r--tests/011/macros-2.txr2
-rw-r--r--tests/012/struct.tl24
2 files changed, 13 insertions, 13 deletions
diff --git a/tests/011/macros-2.txr b/tests/011/macros-2.txr
index a6693c6b..0d7cc607 100644
--- a/tests/011/macros-2.txr
+++ b/tests/011/macros-2.txr
@@ -22,7 +22,7 @@
(prinl
(ignwarn
- (sys:expand
+ (expand
'(whilst ((< i 100))
(if (< (inc i) 20)
continue)
diff --git a/tests/012/struct.tl b/tests/012/struct.tl
index 99b2a3eb..9de3f832 100644
--- a/tests/012/struct.tl
+++ b/tests/012/struct.tl
@@ -13,7 +13,7 @@
(test ^#S(bar b ,(+ 2 2))
#S(bar a 103 b 4))
-(test (sys:expand '^#S(bar b ,(+ 2 2)))
+(test (expand '^#S(bar b ,(+ 2 2)))
(sys:make-struct-lit 'bar (list 'b (+ 2 2))))
(defvar s (eval ^#S(bar b ,(+ 2 2))))
@@ -24,36 +24,36 @@
(test s
#S(bar a 100 b 4))
-(test (ignwarn (sys:expand 'a.b.c.d))
+(test (ignwarn (expand 'a.b.c.d))
(slot (slot (slot a 'b)
'c) 'd))
-(test (sys:expand 's.a)
+(test (expand 's.a)
(slot s 'a))
-(test (sys:expand 's.[a])
+(test (expand 's.[a])
[(slot s 'a)])
-(test (sys:expand 's.[a b c])
+(test (expand 's.[a b c])
[(slot s 'a) b c])
(set *gensym-counter* 0)
-(stest (ignwarn (sys:expand 's.(a)))
+(stest (ignwarn (expand 's.(a)))
"(call (slot s 'a)\n \
\ s)")
(set *gensym-counter* 0)
-(stest (ignwarn (sys:expand 's.(a b c)))
+(stest (ignwarn (expand 's.(a b c)))
"(call (slot s 'a)\n \
\ s b c)")
-(test (sys:expand 's.[a].d)
+(test (expand 's.[a].d)
(slot [(slot s 'a)] 'd))
-(test (sys:expand 's.[a b c].d)
+(test (expand 's.[a b c].d)
(slot [(slot s 'a) b c] 'd))
(set *gensym-counter* 0)
-(stest (ignwarn (sys:expand 's.(a).d))
+(stest (ignwarn (expand 's.(a).d))
"(slot (call (slot s 'a)\n \
\ s)\n \
\ 'd)")
(set *gensym-counter* 0)
-(stest (ignwarn (sys:expand 's.(a b c).d))
+(stest (ignwarn (expand 's.(a b c).d))
"(slot (call (slot s 'a)\n \
\ s b c)\n \
\ 'd)")
@@ -63,7 +63,7 @@
(test (new foo) #S(foo a 42))
(set *gensym-counter* 0)
-(stest (sys:expand '(defstruct (boa x y) nil
+(stest (expand '(defstruct (boa x y) nil
(x 0) (y 0)))
"(sys:make-struct-type 'boa '() '()\n \
\ '(x y) () (lambda (#:g0008)\n \