From bdefeae949effdbf45dfbf14475b2b795ef50cb2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 10 Feb 2015 06:50:26 -0800 Subject: * eval.c (symacro_k, fun_k): New keyword variables. (lexical_lisp1_binding): New static function. (eval_init): Initialize symacro_k and fun_k; register new intrinsic function lexical-lisp1-binding. * match.h (var_k): Existing external name declared. * txr.1: Documented lexical-lisp1-binding. --- txr.1 | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index be830b38..0be270f4 100644 --- a/txr.1 +++ b/txr.1 @@ -26151,6 +26151,42 @@ However, it can be macro-expanded to .code x which is a lexical variable. +.coNP Function @ lexical-lisp1-binding +.synb +.mets (lexical-lisp1-binding < env << symbol) +.syne +.desc +The +.code lexical-lisp1-binding +function inspects the macro-time environment +.meta env +to determine what kind of binding, if any, does +.meta symbol +have in that environment, from a Lisp-1 perspective. + +That is to say, it considers function bindings, variable bindings +and symbol macro bindings to be in a single name space and finds +the innermost binding of one of these types for +.metn symbol . + +If such a binding is found, then the function returns one of +the three keyword symbols +.codn :var , +.codn :fun , +or +.codn :symacro . + +If no such lexical binding is found, then the function +returns +.codn nil . + +Note that a +.code nil +return doesn't mean that the symbol doesn't have a lexical binding. It could +have an operator macro lexical binding (a macro binding in the function +namespace established by +.codn macrolet ). + .coNP Operator @ defsymacro .synb .mets (defsymacro < sym << form ) -- cgit v1.2.3