File: requires.scm

package info (click to toggle)
scm 5e5-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,492 kB
  • ctags: 7,426
  • sloc: ansic: 34,856; lisp: 15,707; makefile: 724; asm: 288; sh: 263
file content (21 lines) | stat: -rw-r--r-- 774 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
;;; "require.scm" Trampoline to slib/require.scm

(define library-vicinity
  (let* ((vl (case (software-type)
	       ((amiga) '(#\: #\/))
	       ((ms-dos windows atarist os/2) '(#\\ #\/))
	       ((macos thinkc) '(#\:))
	       ((nosve) '(#\: #\.))
	       ((unix coherent plan9) '(#\/))
	       ((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)))