diff options
author | Andy Wingo <wingo@pobox.com> | 2011-03-29 12:38:18 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-03-29 12:38:18 +0200 |
commit | fb6df3ea137eabad25d70219da2c84282883b433 (patch) | |
tree | 719fa607ce8bb83b960a687c864bdc123fb544dd /module/system/repl/command.scm | |
parent | 2460274d360d36bc758b763a1bbb1dc2cb85a87b (diff) | |
download | guile-fb6df3ea137eabad25d70219da2c84282883b433.tar.gz |
fix error message on ,disassemble "non-procedure"
* module/language/objcode/spec.scm (decompile-value): Don't assume that
`error' will handle format strings appropriately.
* module/system/repl/command.scm (disassemble): A more human error when
you disassemble a non-procedure.
Bug reported by Andrew Horton.
Diffstat (limited to 'module/system/repl/command.scm')
-rw-r--r-- | module/system/repl/command.scm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm index 87ab993a5..109b533f8 100644 --- a/module/system/repl/command.scm +++ b/module/system/repl/command.scm @@ -465,7 +465,11 @@ Compile a file." (define-meta-command (disassemble repl (form)) "disassemble EXP Disassemble a compiled procedure." - (guile:disassemble (repl-eval repl (repl-parse repl form)))) + (let ((obj (repl-eval repl (repl-parse repl form)))) + (if (or (program? obj) (objcode? obj)) + (guile:disassemble obj) + (format #t "Argument to ,disassemble not a procedure or objcode: ~a~%" + obj)))) (define-meta-command (disassemble-file repl file) "disassemble-file FILE |