summaryrefslogtreecommitdiffstats
path: root/stdlib/doc-syms.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-10-03 22:10:32 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-10-03 22:10:32 -0700
commit9c1e2974fad18576c0051d046f03d799d2879fdc (patch)
treef67f60de1965f70ec4c717486ef4b88871e61ad1 /stdlib/doc-syms.tl
parent502543ea94913ec4d4792dbd07151fba22220637 (diff)
downloadtxr-9c1e2974fad18576c0051d046f03d799d2879fdc.tar.gz
txr-9c1e2974fad18576c0051d046f03d799d2879fdc.tar.bz2
txr-9c1e2974fad18576c0051d046f03d799d2879fdc.zip
New: %fun% mechanism for current function name.
* eval.c (pct_fun_s): New symbol variable, holding the usr:%fun% symbol. (fun_macro_env): New static function. (do_expand): For defun and defmacro, use fun_macro_env to establish an environment binding the %fun% symbol macro, and expand everything in that environment. (eval_init): Intern the %fun% symbol, initializing pct_fun_s, and also register a global symbol macro in that name so that we can freely use %fun% everywhere without worrying that the code will blow up. E.g. a logging macro can use it to get the function name, but still be useful in a top-level form outside of a named function. * stdlib/struct.tl (sys:meth-lambda): New macro. (defstruct, defmeth): Use sys:meth-lambda as a replacement for lambda to set up the %fun% symbol macro. In the :init case which doesn't use a lambda, an open-coded symacrolet does the job. * tests/019/pct-fun.tl: New file. * tests/019/pct-fun.expected: Likewise. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib/doc-syms.tl')
-rw-r--r--stdlib/doc-syms.tl1
1 files changed, 1 insertions, 0 deletions
diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl
index 30c81243..59535d41 100644
--- a/stdlib/doc-syms.tl
+++ b/stdlib/doc-syms.tl
@@ -2,6 +2,7 @@
(hash-from-pairs
'(("!>" "N-02B10DF9")
("%e%" "N-03F0FA9E")
+ ("%fun%" "N-00719365")
("%pi%" "N-03F0FA9E")
("*" "N-022396F7")
("*args*" "N-03DEE18A")