mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-10 11:12:58 -08:00
Better control of the type of arguments in DISASSEMBLE.
This commit is contained in:
parent
1bf5ae26e9
commit
4e86c768f5
2 changed files with 22 additions and 7 deletions
|
|
@ -14,6 +14,9 @@ ECL 0.9h
|
|||
|
||||
- LOAD can now load code from streams which are not associated to files.
|
||||
|
||||
- DISASSEMBLE now signals a TYPE-ERROR condition when the argument is neither
|
||||
an extended function designator nor a lambda expression.
|
||||
|
||||
* Design:
|
||||
|
||||
- Simplified the structure of the frame stack, removing redundant fields.
|
||||
|
|
|
|||
|
|
@ -647,11 +647,10 @@ Cannot compile ~a."
|
|||
(setq *error-p* t)
|
||||
(values name t t)))))
|
||||
|
||||
(defun disassemble (&optional (thing nil)
|
||||
&key (h-file nil) (data-file nil)
|
||||
&aux def disassembled-form
|
||||
(*compiler-in-use* *compiler-in-use*)
|
||||
(*print-pretty* nil))
|
||||
(defun disassemble (thing &key (h-file nil) (data-file nil)
|
||||
&aux def disassembled-form
|
||||
(*compiler-in-use* *compiler-in-use*)
|
||||
(*print-pretty* nil))
|
||||
(when (si::valid-function-name-p thing)
|
||||
(setq thing (fdefinition thing)))
|
||||
(cond ((null thing))
|
||||
|
|
@ -659,9 +658,22 @@ Cannot compile ~a."
|
|||
(unless (si::bc-disassemble thing)
|
||||
(warn "Cannot disassemble the binary function ~S because I do not have its source code." thing)
|
||||
(return-from disassemble nil)))
|
||||
((and (consp thing) (eq (car thing) 'LAMBDA))
|
||||
((atom thing)
|
||||
(error 'simple-type-error
|
||||
:datum thing
|
||||
:expected-type '(OR FUNCTION (SATISFIES SI:VALID-FUNCTION-NAME-P))
|
||||
:format-control "DISASSEMBLE cannot accept ~A"
|
||||
:format-arguments (list thing)))
|
||||
((eq (car thing) 'LAMBDA)
|
||||
(setq disassembled-form `(defun gazonk ,@(cdr thing))))
|
||||
(t (setq disassembled-form thing)))
|
||||
((eq (car thing) 'EXT:LAMBDA-BLOCK)
|
||||
(setq disassembled-form `(defun ,@(rest thing))))
|
||||
(t
|
||||
(error 'simple-type-error
|
||||
:datum thing
|
||||
:expected-type '(OR FUNCTION (SATISFIES SI:VALID-FUNCTION-NAME-P))
|
||||
:format-control "DISASSEMBLE cannot accept ~A"
|
||||
:format-arguments (list thing))))
|
||||
(when *compiler-in-use*
|
||||
(format t "~&;;; The compiler was called recursively.~
|
||||
~%Cannot disassemble ~a." thing)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue