1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 15:00:21 +02:00

Remove frame->module

* module/system/repl/debug.scm (frame->module): Remove.  Has been broken
  for a while, had no callers, and was calling frame-procedure.  We can
  revive again in a better way, like ice-9 local-eval.
This commit is contained in:
Andy Wingo 2015-11-27 15:29:33 +01:00
parent dfbe869e24
commit a7e1c392c2

View file

@ -34,7 +34,7 @@
make-debug debug?
debug-frames debug-index debug-error-message
terminal-width
print-registers print-locals print-frame print-frames frame->module
print-registers print-locals print-frame print-frames
stack->vector narrow-stack->vector
frame->stack-vector))
@ -164,33 +164,6 @@
(lp (+ i inc)
(frame-source frame)))))))
;; Ideally here we would have something much more syntactic, in that a set! to a
;; local var that is not settable would raise an error, and export etc forms
;; would modify the module in question: but alack, this is what we have now.
;; Patches welcome!
(define (frame->module frame)
(let ((proc (frame-procedure frame)))
(if #f
;; FIXME: program-module does not exist.
(let* ((mod (or (program-module proc) (current-module)))
(mod* (make-module)))
(module-use! mod* mod)
(for-each
(lambda (binding)
(let* ((x (frame-local-ref frame (binding-slot binding)
(binding-representation binding)))
(var (if (variable? x) x (make-variable x))))
(format #t
"~:[Read-only~;Mutable~] local variable ~a = ~70:@y\n"
(not (variable? x))
(binding-name binding)
(if (variable-bound? var) (variable-ref var) var))
(module-add! mod* (binding-name binding) var)))
(frame-bindings frame))
mod*)
(current-module))))
(define (stack->vector stack)
(let* ((len (stack-length stack))
(v (make-vector len)))