diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-03-23 19:37:08 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-03-23 19:37:08 -0700 |
commit | c694663ac8e567c54a0ab09c3953b9229423fbf8 (patch) | |
tree | 2ae02a3801629f7ebc138dd1069e5ecc42a72304 /stdlib/compiler.tl | |
parent | 83788938a4936726598b64fb5059fa5ce55f828a (diff) | |
download | txr-c694663ac8e567c54a0ab09c3953b9229423fbf8.tar.gz txr-c694663ac8e567c54a0ab09c3953b9229423fbf8.tar.bz2 txr-c694663ac8e567c54a0ab09c3953b9229423fbf8.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.tl | 6 |
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)) |