summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-03-17 08:51:00 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-03-17 08:51:00 -0700
commit0f7a74aa02bc9deb2ae269113e565a63b6f64bd2 (patch)
treebf3788a2d8a08a64b21cadd2efe2e1243852d44e
parenta0f18bf76682b4c49f7fb66bdbdcb4dad23483ec (diff)
downloadtxr-0f7a74aa02bc9deb2ae269113e565a63b6f64bd2.tar.gz
txr-0f7a74aa02bc9deb2ae269113e565a63b6f64bd2.tar.bz2
txr-0f7a74aa02bc9deb2ae269113e565a63b6f64bd2.zip
compile-toplevel: expand with warnings.
* eval.c (eval_init): Expose raw expand function as sys:expand*, since sys:expand squelches warnings. * share/txr/stdlib/compiler.tl (usr:compile-toplevel): Use expand* instead of expand.
-rw-r--r--eval.c1
-rw-r--r--share/txr/stdlib/compiler.tl2
2 files changed, 2 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 2ec81848..b04b15a2 100644
--- a/eval.c
+++ b/eval.c
@@ -6244,6 +6244,7 @@ void eval_init(void)
reg_var(load_path_s, nil);
reg_symacro(intern(lit("self-load-path"), user_package), load_path_s);
reg_fun(intern(lit("expand"), system_package), func_n2o(no_warn_expand, 1));
+ reg_fun(intern(lit("expand*"), system_package), func_n2o(expand, 1));
reg_fun(intern(lit("expand-with-free-refs"), system_package),
func_n3o(expand_with_free_refs, 1));
reg_fun(intern(lit("macro-form-p"), user_package), func_n2o(macro_form_p, 1));
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index adf85e37..e10bf1a7 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -483,6 +483,6 @@
(defun usr:compile-toplevel (exp)
(let ((co (new compiler))
(as (new assembler)))
- (let ((frag co.(compile (new env) (expand exp))))
+ (let ((frag co.(compile (new env) (expand* exp))))
as.(asm ^(,*frag.code (end ,frag.oreg)))
(vm-make-desc co.nlev co.nreg as.buf co.(get-datavec)))))