diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-11-19 21:04:49 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-11-19 21:04:49 -0800 |
commit | 50cbab589eb6e5b841dd2e916a1026f477b7be15 (patch) | |
tree | 03b7c6f09949fae488b37e88467ca334a2b30fa7 /share/txr/stdlib/trace.tl | |
parent | aacf701d451639f393d964e7bd60e18d24a7f68d (diff) | |
download | txr-50cbab589eb6e5b841dd2e916a1026f477b7be15.tar.gz txr-50cbab589eb6e5b841dd2e916a1026f477b7be15.tar.bz2 txr-50cbab589eb6e5b841dd2e916a1026f477b7be15.zip |
Diagnose undefined functions in trace.
* share/txr/stdlib/trace.tl (sys:trace): If symbol-function
returns nil, throw exception.
* txr.1: Document the behavior, along with return values
of trace and untrace, and the tolerance of untrace to
bad arguments.
Diffstat (limited to 'share/txr/stdlib/trace.tl')
-rw-r--r-- | share/txr/stdlib/trace.tl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/share/txr/stdlib/trace.tl b/share/txr/stdlib/trace.tl index 951b67f8..33a1bf08 100644 --- a/share/txr/stdlib/trace.tl +++ b/share/txr/stdlib/trace.tl @@ -16,7 +16,9 @@ (each ((n names)) (unless [sys:*trace-hash* n] (let* ((name n) - (prev (symbol-function n)) + (prev (or (symbol-function n) + (throwf 'eval-error + "~s: ~s does not name a function" 'trace n))) (hook (lambda (. args) (let ((abandoned t) (sys:*trace-level* (succ sys:*trace-level*))) |