diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-02-16 16:03:38 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-02-16 16:03:38 -0800 |
commit | 4c8dfaaf842db7c8e34d34b83d9cf38627f120da (patch) | |
tree | 8f80502cd7a821fa7c0fe9ba45cb4ad7043f78f1 /match.c | |
parent | 9a78780d28d1e74f66338376f9604b4773161d8a (diff) | |
download | txr-4c8dfaaf842db7c8e34d34b83d9cf38627f120da.tar.gz txr-4c8dfaaf842db7c8e34d34b83d9cf38627f120da.tar.bz2 txr-4c8dfaaf842db7c8e34d34b83d9cf38627f120da.zip |
Lisp load function supports .txr files.
* eval.c (load): Instead of throwing error when a .txr file
is opened, process it according to sensible requirements.
* match.c (v_load): Store bindings in the current environment
frame before evaluating Lisp, and then update afterward.
This allows .txr files loaded from Lisp to continue matching
with the current bindings and extend those bindings.
* txr.1: Update documentation of load.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -4308,11 +4308,15 @@ static val v_load(match_files_ctx *c) } } } else { + uw_set_match_context(cons(c->spec, c->bindings)); + if (!read_eval_stream(stream, std_error)){ close_stream(stream, nil); sem_error(specline, lit("load: ~a contains errors"), path, nao); } + c->bindings = cdr(uw_get_match_context()); + ret = (sym == include_s) ? nil : next_spec_k; } |