From 8c8a13ecf5ee7c2d8342259cb9d187b8b16f1327 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 10 Jul 2010 11:16:16 +0200 Subject: [PATCH] value-history-enabled? accessor * module/ice-9/history.scm (value-history-enabled?): Add accessor. (enable-value-history!, disable-value-history!): Adapt. --- module/ice-9/history.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/module/ice-9/history.scm b/module/ice-9/history.scm index 7c5998861..7761dae08 100644 --- a/module/ice-9/history.scm +++ b/module/ice-9/history.scm @@ -18,12 +18,14 @@ ;;;; 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) @@ -42,18 +44,18 @@ (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))))