File: requires.scm

package info (click to toggle)
scm 5d2-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,452 kB
  • ctags: 4,089
  • sloc: ansic: 28,351; lisp: 5,660; makefile: 503; sh: 171; asm: 22
file content (22 lines) | stat: -rw-r--r-- 816 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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"))