deprecate `bad-throw'
authorAndy Wingo <wingo@pobox.com>
Fri, 11 Jun 2010 09:31:21 +0000 (11:31 +0200)
committerAndy Wingo <wingo@pobox.com>
Fri, 11 Jun 2010 14:58:31 +0000 (16:58 +0200)
* module/ice-9/boot-9.scm:
* module/ice-9/scm-style-repl.scm (bad-throw): Move here. This function
  was never documented, but has been around since guile-ii. It's not
  used with current code though.

* module/ice-9/deprecated.scm: Provide bad-throw in default env.

* module/ice-9/debugger/commands.scm: Import bad-throw from
  scm-style-repl.

module/ice-9/boot-9.scm
module/ice-9/debugger/commands.scm
module/ice-9/deprecated.scm
module/ice-9/scm-style-repl.scm

index 56c7d73..b46009c 100644 (file)
@@ -855,17 +855,6 @@ If there is no handler at all, Guile prints an error and then exits."
      (let ((msg (string-join (cons "~A" (make-list (length args) "~S")))))
        (scm-error 'misc-error #f msg (cons message args) #f)))))
 
-;; bad-throw is the hook that is called upon a throw to a an unhandled
-;; key (unless the throw has four arguments, in which case
-;; it's usually interpreted as an error throw.)
-;; If the key has a default handler (a throw-handler-default property),
-;; it is applied to the throw.
-;;
-(define (bad-throw key . args)
-  (let ((default (symbol-property key 'throw-handler-default)))
-    (or (and default (apply default key args))
-        (apply error "unhandled-exception:" key args))))
-
 \f
 
 (define (tm:sec obj) (vector-ref obj 0))
index dbb06c1..56f1662 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; (ice-9 debugger commands) -- debugger commands
 
-;;; Copyright (C) 2002, 2006, 2009 Free Software Foundation, Inc.
+;;; Copyright (C) 2002, 2006, 2009, 2010 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
@@ -18,6 +18,7 @@
 
 (define-module (ice-9 debugger commands)
   #:use-module (ice-9 debug)
+  #:use-module ((ice-9 scm-style-repl) #:select (bad-throw))
   #:use-module (ice-9 debugger)
   #:use-module (ice-9 debugger state)
   #:use-module (ice-9 debugger utils)
index 3c2a4dd..6c57514 100644 (file)
@@ -39,6 +39,7 @@
             closure?
             %nil
             @bind
+            bad-throw
             error-catching-loop
             error-catching-repl
             scm-style-repl
@@ -356,6 +357,12 @@ deprecated. Use set-module-public-interface! instead.")
           (setter mod iface)
           (module-define! mod '%module-public-interface iface))))
 
+(define (bad-throw key . args)
+  (issue-deprecation-warning 
+   "`bad-throw' in the default environment is deprecated.
+Find it in the `(ice-9 scm-style-repl)' module instead.")
+  (apply (@ (ice-9 scm-style-repl) bad-throw) key args))
+
 (define (error-catching-loop thunk)
   (issue-deprecation-warning 
    "`error-catching-loop' in the default environment is deprecated.
index e544872..01e9de4 100644 (file)
 
 (define-module (ice-9 scm-style-repl)
   ;; #:replace, as with deprecated code enabled these will be in the root env
-  #:replace (error-catching-loop
+  #:replace (bad-throw
+             error-catching-loop
              error-catching-repl
              scm-style-repl))
 
+;; bad-throw is the hook that is called upon a throw to a an unhandled
+;; key (unless the throw has four arguments, in which case
+;; it's usually interpreted as an error throw.)
+;; If the key has a default handler (a throw-handler-default property),
+;; it is applied to the throw.
+;;
+(define (bad-throw key . args)
+  (let ((default (symbol-property key 'throw-handler-default)))
+    (or (and default (apply default key args))
+        (apply error "unhandled-exception:" key args))))
+
+\f
+
 (define (error-catching-loop thunk)
   (let ((status #f)
         (interactive #t))