guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 17/41: Remove frame->module


From: Andy Wingo
Subject: [Guile-commits] 17/41: Remove frame->module
Date: Wed, 02 Dec 2015 08:06:51 +0000

wingo pushed a commit to branch master
in repository guile.

commit a7e1c392c27481f1f8bda11bd8ceb0fde9f06c14
Author: Andy Wingo <address@hidden>
Date:   Fri Nov 27 15:29:33 2015 +0100

    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.
---
 module/system/repl/debug.scm |   29 +----------------------------
 1 files changed, 1 insertions(+), 28 deletions(-)

diff --git a/module/system/repl/debug.scm b/module/system/repl/debug.scm
index e148d44..18ac10f 100644
--- a/module/system/repl/debug.scm
+++ b/module/system/repl/debug.scm
@@ -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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]