From 25f06fa13e92347e9a4d3e506473642e593aeccc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 26 Sep 2016 21:32:04 -0700 Subject: Use *load-path* in load/include directive. * match.c (v_load): Obtain parent load path from *load-path* variable, rather than from source location info associated with the directive. This changes the semantics of when a @(load ...) occurs in code included via @(include ...). That @(load ...) is processed in the *load-path* context of the parent, rather than the include. * tests/011/txr-case.txr: Load txr-case.txr from the standard library, rather than include it. Otherwise txr-case.txr looks for txr-case.tl in tests/011. --- match.c | 2 +- tests/011/txr-case.txr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/match.c b/match.c index 75407cd9..f1c1dba4 100644 --- a/match.c +++ b/match.c @@ -3865,7 +3865,7 @@ static val v_load(match_files_ctx *c) spec_bind (specline, first_spec, c->spec); val sym = first(first_spec); val args = rest(first_spec); - val parent = or2(cdr(source_loc(specline)), null_string); + val parent = or2(load_path, null_string); val target = tleval(specline, first(args), c->bindings); if (rest(specline)) diff --git a/tests/011/txr-case.txr b/tests/011/txr-case.txr index f427be9e..1aa80478 100644 --- a/tests/011/txr-case.txr +++ b/tests/011/txr-case.txr @@ -1,4 +1,4 @@ -@(include `@stdlib/txr-case`) +@(load `@{stdlib}txr-case`) @(define date (year month day)) @{year /\d\d\d\d/}-@{month /\d\d/}-@{day /\d\d/} @(end) -- cgit v1.2.3