From 3278b75942bdbe706f7a0fba87729bb1e935b68b Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:25 -0800 Subject: Import Upstream version 5d2 --- requires.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 requires.scm (limited to 'requires.scm') diff --git a/requires.scm b/requires.scm new file mode 100644 index 0000000..bd4b8bf --- /dev/null +++ b/requires.scm @@ -0,0 +1,22 @@ +;;; "require.scm" Trampoline to slib/require.scm + +(set! library-vicinity + (let* ((vl (case (software-type) + ((AMIGA) '(#\: #\/)) + ((MS-DOS WINDOWS ATARIST OS/2) '(#\\ #\/)) + ((MACOS THINKC) '(#\:)) + ((NOSVE) '(#\: #\.)) + ((UNIX COHERENT) '(#\/)) + ((VMS) '(#\: #\])))) + (iv (implementation-vicinity)) + (vc (and (positive? (string-length iv)) + (string-ref iv (+ -1 (string-length iv))))) + (vs (if (memv vc vl) (string vc) "/")) + (lv (let loop ((pos (+ -2 (string-length iv)))) + (cond ((or (< pos 0) (not vs)) + (string-append iv ".." vs "slib" vs)) + ((memv (string-ref iv pos) vl) + (string-append (substring iv 0 (+ 1 pos)) "slib" vs)) + (else (loop (- pos 1))))))) + (lambda () lv))) +(load (in-vicinity (library-vicinity) "require")) -- cgit v1.2.3