io: fix current-directory and related parameters

For consistency with traditional Racket, the guards need to be
implemented through derived parameters instead of chaperones.
This commit is contained in:
Matthew Flatt 2018-11-14 20:31:06 -07:00
parent caf28648e3
commit 3e480f1c93

View File

@ -44,13 +44,17 @@
path]))
(define/who current-directory
(chaperone-procedure raw:current-directory (make-guard-paths who)))
(let ([guard (make-guard-paths who)])
(make-derived-parameter raw:current-directory guard guard)))
(define/who current-directory-for-path->complete-path
(chaperone-procedure raw:current-directory (make-guard-paths 'path->complete-path)))
(let ([guard (make-guard-paths 'path->complete-path)])
(make-derived-parameter raw:current-directory guard guard)))
(define/who current-directory-for-user
(chaperone-procedure raw:current-directory-for-user (make-guard-paths who)))
(let ([guard (make-guard-paths who)])
(make-derived-parameter raw:current-directory-for-user guard guard)))
(define/who current-load-relative-directory
(chaperone-procedure raw:current-load-relative-directory (make-guard-paths who)))
(let ([guard (make-guard-paths who)])
(make-derived-parameter raw:current-load-relative-directory guard guard)))