diff options
author | Andy Wingo <wingo@pobox.com> | 2009-04-22 22:23:43 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-04-22 22:23:43 +0200 |
commit | eb5d1f882672345231bca226e140b2a91718d348 (patch) | |
tree | 91b1906931c4c9e7edbe140555fc5bed39458bcb | |
parent | efa6f9d944174427a3125aa4773e5f6a7e04acdd (diff) | |
download | guile-eb5d1f882672345231bca226e140b2a91718d348.tar.gz |
move pk, peek, and warn to the beginning of boot-9
* 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.
-rw-r--r-- | module/ice-9/boot-9.scm | 69 |
1 files changed, 32 insertions, 37 deletions
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index f3cf9b0a5..48d822bfc 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -40,6 +40,38 @@ +;;; {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))))) + + + ;;; {Features} ;;; @@ -201,38 +233,6 @@ -;;; {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))))) - - - ;;; {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)) - ;;; {Autoloading modules} |