forked from alvatar/spheres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gambini
42 lines (35 loc) · 1.54 KB
/
.gambini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
;; SchemeSpheres configuration file for Gambit
;; For setup, you need to update 1) and 2)
;; -- 1) ADD THE ROOT SEARCH PATH /spheres, AND PATHS WHERE YOU HAVE THE LIBRARIES
(define %%spheres-root-search-paths
`("~~lib/spheres"
"~/Dropbox/projects/spheres"
,(with-exception-handler (lambda (e) "~~") (lambda () (getenv "TRAVIS_BUILD_DIR")))))
(define %%spheres-library-paths
`("~~lib/spheres"
"~/Dropbox/projects/spheres"
,(with-exception-handler (lambda (e) "~~") (lambda () (getenv "TRAVIS_BUILD_DIR")))))
;; Find the Spheres root dir among the given search paths
(define %%spheres-root-dir
(let ((choose-first-exists
(lambda (paths)
(let recur ((paths paths))
(cond ((null? paths) (error "Provided root directories do not exist"))
((file-exists? (car paths))
(car paths))
(else (recur (cdr paths))))))))
(choose-first-exists %%spheres-root-search-paths)))
;; Gambit lightweight library support
(for-each eval (with-input-from-file
(string-append %%spheres-root-dir "/spheres/gambit/library.scm")
read-all))
;; Load syntax-case expander
(load (string-append %%spheres-root-dir "/spheres/gambit/syntax-case.o1"))
;; Eval Gambit prelude for SchemeSpheres
(for-each eval (with-input-from-file
(string-append %%spheres-root-dir "/spheres/gambit/prelude.scm")
read-all))
(for-each %add-library-path! %%spheres-library-paths)
;; -- 2) SET UP AN ENVIRONMENT
(eval '(add-cond-expand-feature! debug))
(eval `(include ,(string-append %%spheres-root-dir "/spheres/gambit/environments.scm")))