From fd1473136898716cecf77de5a029c58e98f2a682 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 8 Dec 2015 21:20:38 -0800 Subject: New function macro-ancestor. * eval.c (eval_init): Register lookup_origin as macro-ancestor intrinsic. * txr.1: Documented. --- eval.c | 1 + txr.1 | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/eval.c b/eval.c index c3ceede9..9e2b73e1 100644 --- a/eval.c +++ b/eval.c @@ -5036,6 +5036,7 @@ void eval_init(void) reg_fun(intern(lit("source-loc"), user_package), func_n1(source_loc)); reg_fun(intern(lit("source-loc-str"), user_package), func_n2o(source_loc_str, 1)); + reg_fun(intern(lit("macro-ancestor"), user_package), func_n1(lookup_origin)); reg_fun(intern(lit("rlcp"), user_package), func_n2(rlcp)); eval_error_s = intern(lit("eval-error"), user_package); diff --git a/txr.1 b/txr.1 index e130c6cb..aa281265 100644 --- a/txr.1 +++ b/txr.1 @@ -36801,6 +36801,24 @@ source code location info also, so that when the \*(TL evaluator encounters errors in transformed code, it can give diagnostics which refer to the original untransformed source code. +.coNP Function @ macro-ancestor +.synb +.mets (macro-ancestor << form ) +.syne +.desc +The +.code macro-ancestor +function returns information about the macro-expansion ancestor of +.metn form . +The ancestor is the original form whose expansion produced +.metn form . + +If +.meta form +is not the result of macro-expansion, or the ancestor information +is unavailable, the function returns +.codn nil . + .SS* Profiling .coNP Operator @ prof .synb -- cgit v1.2.3