summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-06-12 07:43:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-06-12 07:43:45 -0700
commit42854d80a361e297a1dee69bebbb6c53d79f2d19 (patch)
treeddb9c576e9d6297104d2f65c454bd0b12070dda7 /match.c
parentff7c7432e48776dbfc970d19bb81c6fe6075c117 (diff)
downloadtxr-42854d80a361e297a1dee69bebbb6c53d79f2d19.tar.gz
txr-42854d80a361e297a1dee69bebbb6c53d79f2d19.tar.bz2
txr-42854d80a361e297a1dee69bebbb6c53d79f2d19.zip
* Makefile: Install share/txr/stdlib/*.txr material.
* match.c (do_txeval): If a variable is not in the bindings, fall back on treating it as a TXR Lisp dynamic variable. This allows us to refer to the stdlib variable from a quasistring in a @(load ...) directive. * txr.c (sysroot_init): Register new variable, *txr-version*. * share/txr/stdlib/ver.txr: New file.
Diffstat (limited to 'match.c')
-rw-r--r--match.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/match.c b/match.c
index 4d21b583..e393e9b3 100644
--- a/match.c
+++ b/match.c
@@ -1432,6 +1432,7 @@ static val do_txeval(val spec, val form, val bindings, val allow_unbound)
{
val ret = nil;
uw_mark_frame;
+ uses_or2;
uw_catch_begin (cons(query_error_s, nil), exc_sym, exc);
if (!form)
@@ -1441,7 +1442,7 @@ static val do_txeval(val spec, val form, val bindings, val allow_unbound)
if (!form) {
ret = form;
} else if (bindable(form)) {
- val binding = assoc(form, bindings);
+ val binding = or2(assoc(form, bindings), lookup_var(nil, form));
if (!binding) {
if (allow_unbound)
ret = noval_s;