* 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.
;;; Guile Lowlevel Intermediate Language
-;; Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2009, 2010, 2011 Free Software Foundation, Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
((objcode? x)
(values x #f))
(else
- (error "can't decompile ~A: not a program or objcode" x))))
+ (error "Object for disassembly not a program or objcode" x))))
(define-language objcode
#:title "Guile Object Code"
(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