From 3e480f1c931f8c4ea69cc1849945e8733a48fdd7 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 14 Nov 2018 20:31:06 -0700 Subject: [PATCH] io: fix `current-directory` and related parameters For consistency with traditional Racket, the guards need to be implemented through derived parameters instead of chaperones. --- racket/src/io/path/api.rkt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/racket/src/io/path/api.rkt b/racket/src/io/path/api.rkt index 61fe9f17b7..f10f309c5c 100644 --- a/racket/src/io/path/api.rkt +++ b/racket/src/io/path/api.rkt @@ -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)))