move pk, peek, and warn to the beginning of boot-9
authorAndy Wingo <wingo@pobox.com>
Wed, 22 Apr 2009 20:23:43 +0000 (22:23 +0200)
committerAndy Wingo <wingo@pobox.com>
Wed, 22 Apr 2009 20:23:43 +0000 (22:23 +0200)
* module/ice-9/boot-9.scm (peek, pk, warn): Move these helpers up to the
  top. I like them!
  (load-compiled): Don't define within an if, syncase doesn't like that.

module/ice-9/boot-9.scm

index f3cf9b0..48d822b 100644 (file)
 
 \f
 
+;;; {Simple Debugging Tools}
+;;;
+
+;; peek takes any number of arguments, writes them to the
+;; current ouput port, and returns the last argument.
+;; It is handy to wrap around an expression to look at
+;; a value each time is evaluated, e.g.:
+;;
+;;     (+ 10 (troublesome-fn))
+;;     => (+ 10 (pk 'troublesome-fn-returned (troublesome-fn)))
+;;
+
+(define (peek . stuff)
+  (newline)
+  (display ";;; ")
+  (write stuff)
+  (newline)
+  (car (last-pair stuff)))
+
+(define pk peek)
+
+(define (warn . stuff)
+  (with-output-to-port (current-error-port)
+    (lambda ()
+      (newline)
+      (display ";;; WARNING ")
+      (display stuff)
+      (newline)
+      (car (last-pair stuff)))))
+
+\f
+
 ;;; {Features}
 ;;;
 
 
 \f
 
-;;; {Simple Debugging Tools}
-;;;
-
-;; peek takes any number of arguments, writes them to the
-;; current ouput port, and returns the last argument.
-;; It is handy to wrap around an expression to look at
-;; a value each time is evaluated, e.g.:
-;;
-;;     (+ 10 (troublesome-fn))
-;;     => (+ 10 (pk 'troublesome-fn-returned (troublesome-fn)))
-;;
-
-(define (peek . stuff)
-  (newline)
-  (display ";;; ")
-  (write stuff)
-  (newline)
-  (car (last-pair stuff)))
-
-(define pk peek)
-
-(define (warn . stuff)
-  (with-output-to-port (current-error-port)
-    (lambda ()
-      (newline)
-      (display ";;; WARNING ")
-      (display stuff)
-      (newline)
-      (car (last-pair stuff)))))
-
-\f
-
 ;;; {Trivial Functions}
 ;;;
 
@@ -2121,11 +2121,6 @@ module '(ice-9 q) '(make-q q-length))}."
              (loop (cddr args)))))))
 
 
-;;; {Compiled module}
-
-(if (not (defined? 'load-compiled))
-    (define load-compiled #f))
-
 \f
 
 ;;; {Autoloading modules}