fixed bug noticed by Sam

svn: r9114

original commit: 97dbca2831151c19871419bba4fede37d4d57c71
This commit is contained in:
Robby Findler 2008-03-29 21:57:35 +00:00
parent f44a26e233
commit 42bd983c66

View File

@ -174,16 +174,14 @@ the state transitions / contracts are:
;; unmarshall-pref : symbol marshalled -> any
;; unmarshalls a preference read from the disk
(define (unmarshall-pref p data)
(let/ec k
(let* ([unmarshall-fn (un/marshall-unmarshall
(hash-table-get marshall-unmarshall
p
(λ () (k data))))]
[default (hash-table-get defaults p)]
[result (unmarshall-fn data)])
(if ((default-checker default) result)
result
(default-value default)))))
(let* ([un/marshall (hash-table-get marshall-unmarshall p #f)]
[result (if un/marshall
((un/marshall-unmarshall un/marshall) data)
data)]
[default (hash-table-get defaults p)])
(if ((default-checker default) result)
result
(default-value default))))
;; add-callback : sym (-> void) -> void
(define preferences:add-callback