summaryrefslogtreecommitdiffstats
path: root/stdlib/compiler.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-03-23 19:37:08 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-03-23 19:37:08 -0700
commite87fe8db114a8bc1ee6a7cff358c75d7401c44a3 (patch)
tree2ae02a3801629f7ebc138dd1069e5ecc42a72304 /stdlib/compiler.tl
parent1c09e666db759a7c056506bc96a2f8bbf298f138 (diff)
downloadtxr-e87fe8db114a8bc1ee6a7cff358c75d7401c44a3.tar.gz
txr-e87fe8db114a8bc1ee6a7cff358c75d7401c44a3.tar.bz2
txr-e87fe8db114a8bc1ee6a7cff358c75d7401c44a3.zip
compiler/doc: document compiler-opts and enable unused warning
* stdlib/compiler.tl (sys:env shadow-fun): Also diagnose if a global macro is shadowed. * txr.1: Documented compiler-opts structure, *compiler-opts* variable and with-compiler-opts macro. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib/compiler.tl')
-rw-r--r--stdlib/compiler.tl6
1 files changed, 4 insertions, 2 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl
index b27a0a82..5e5fff6b 100644
--- a/stdlib/compiler.tl
+++ b/stdlib/compiler.tl
@@ -41,7 +41,7 @@
(defsymacro %warning-syms% '(usr:shadow-fun usr:shadow-var usr:shadow-cross
usr:unused))
-(defvar usr:*compile-opts* (new compile-opts))
+(defvar usr:*compile-opts* (new compile-opts usr:unused t))
(defmacro when-opt (compile-opt . forms)
(with-gensyms (optval)
@@ -167,7 +167,9 @@
((and me.up me.(lookup-fun sym))
(diag me.co.last-form "function ~s shadows local function" sym))
((fboundp sym)
- (diag me.co.last-form "function ~s shadows global function" sym))))
+ (diag me.co.last-form "function ~s shadows global function" sym))
+ ((mboundp sym)
+ (diag me.co.last-form "function ~s shadows global macro" sym))))
(when-opt shadow-cross
(cond
((and me.up me.(lookup-var sym))