summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-02-10 06:50:26 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-02-10 06:50:26 -0800
commitbdefeae949effdbf45dfbf14475b2b795ef50cb2 (patch)
tree22c87c6176f56be42a6acdce3ab644e1d7b3126f /txr.1
parent8da2bf1c19a197df13928c18cd8e4317b9934c66 (diff)
downloadtxr-bdefeae949effdbf45dfbf14475b2b795ef50cb2.tar.gz
txr-bdefeae949effdbf45dfbf14475b2b795ef50cb2.tar.bz2
txr-bdefeae949effdbf45dfbf14475b2b795ef50cb2.zip
* 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.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.136
1 files changed, 36 insertions, 0 deletions
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 )