value-history-enabled? accessor
authorAndy Wingo <wingo@pobox.com>
Sat, 10 Jul 2010 09:16:16 +0000 (11:16 +0200)
committerAndy Wingo <wingo@pobox.com>
Sat, 10 Jul 2010 09:16:16 +0000 (11:16 +0200)
* module/ice-9/history.scm (value-history-enabled?): Add accessor.
  (enable-value-history!, disable-value-history!): Adapt.

module/ice-9/history.scm

index 7c59988..7761dae 100644 (file)
 ;;;; A simple value history support
 
 (define-module (ice-9 history)
-  #:export (enable-value-history! disable-value-history!
+  #:export (value-history-enabled? enable-value-history! disable-value-history!
             clear-value-history!))
 
 (process-define-module '((value-history)))
 
-(define value-history-enabled? #f)
+(define *value-history-enabled?* #f)
+(define (value-history-enabled?)
+  *value-history-enabled?*)
 
 (define (use-value-history x)
   (module-use! (current-module)
            (set! count c))))))
 
 (define (enable-value-history!)
-  (if (not value-history-enabled?)
+  (if (not (value-history-enabled?))
       (begin
         (add-hook! before-eval-hook use-value-history)
         (add-hook! before-print-hook save-value-history)
-        (set! value-history-enabled? #t))))
+        (set! *value-history-enabled?* #t))))
 
 (define (disable-value-history!)
-  (if value-history-enabled?
+  (if (value-history-enabled?)
       (begin
         (remove-hook! before-eval-hook use-value-history)
         (remove-hook! before-print-hook save-value-history)
-        (set! value-history-enabled? #f))))
+        (set! *value-history-enabled?* #f))))
 
 (define (clear-value-history!)
   (let ((history (resolve-module '(value-history))))