From e85a15df9887cce43bd9ff43068480b1734d8f50 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 5 May 2007 00:17:06 +0000 Subject: [PATCH] add support for 'lib paths in define-runtime-path, and change world.ss to use it svn: r6150 --- collects/compiler/embed-unit.ss | 6 ++++++ collects/htdp/world.ss | 4 ++-- collects/mzlib/runtime-path.ss | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/collects/compiler/embed-unit.ss b/collects/compiler/embed-unit.ss index 53f924fb74..2d55a738f3 100644 --- a/collects/compiler/embed-unit.ss +++ b/collects/compiler/embed-unit.ss @@ -674,6 +674,12 @@ (and (file-exists? p) p))) (get-lib-search-dirs)))] + [(and (list? p) + (eq? 'lib (car p))) + (build-path (if (null? (cddr p)) + (collection-path "mzlib") + (apply collection-path (cddr p))) + (cadr p))] [else p])]) (and p (path->bytes diff --git a/collects/htdp/world.ss b/collects/htdp/world.ss index 993f2580d4..045aa5a71b 100644 --- a/collects/htdp/world.ss +++ b/collects/htdp/world.ss @@ -578,8 +578,8 @@ Matthew ;; adds the stop animation and image creation button, ;; whose callbacks runs as a thread in the custodian (define IMAGES "Images") - (define-runtime-path s:pth (build-path (collection-path "icons") "break.png")) - (define-runtime-path i:pth (build-path (collection-path "icons") "file.gif")) + (define-runtime-path s:pth '(lib "break.png" "icons")) + (define-runtime-path i:pth '(lib "file.gif" "icons")) (define (add-stop-and-image-buttons frame the-play-back-custodian) (define p (new horizontal-pane% [parent frame][alignment '(center center)])) (define S ((bitmap-label-maker (string-constant break-button-label) s:pth) '_)) diff --git a/collects/mzlib/runtime-path.ss b/collects/mzlib/runtime-path.ss index 2b9741e9af..ef918e8075 100644 --- a/collects/mzlib/runtime-path.ss +++ b/collects/mzlib/runtime-path.ss @@ -67,6 +67,14 @@ p))) (get-lib-search-dirs)) (cadr p)))] + [(and (list? p) + ((length p) . > . 1) + (eq? 'lib (car p)) + (andmap string? (cdr p))) + (let ([dir (if (null? (cddr p)) + (collection-path "mzlib") + (apply collection-path (cddr p)))]) + (build-path dir (cadr p)))] [else (error 'runtime-path "unknown form: ~e" p)]))) paths)))