File tree Expand file tree Collapse file tree 4 files changed +6
-24
lines changed Expand file tree Collapse file tree 4 files changed +6
-24
lines changed Original file line number Diff line number Diff line change 22
22
(set *static-globals* [
23
23
shen.*infs* shen.*call* shen.*occurs*
24
24
shen.*special* shen.*extraspecial*
25
- shen.*platform-native-call-check*
26
25
shen.*demodulation-function*
27
26
shen.*gensym*
28
27
*stinput* *stoutput* *sterror*
Original file line number Diff line number Diff line change 5
5
(kl:set '*implementation* " chez-scheme" )
6
6
(kl:set '*release* (call-with-values scheme-version-number (lambda (major minor patch ) (format " ~s.~s.~s" major minor patch))))
7
7
(kl:set '*porters* " Bruno Deferrari" )
8
- (kl:set '*home-directory* (current-directory))
9
- (kl:set 'shen.*initial-home-directory* (current-directory))
10
8
11
9
(register-globals)
12
10
13
11
(kl:global/*sterror* (standard-error-port))
14
12
(kl:global/*stinput* (standard-input-port))
15
13
(kl:global/*stoutput* (standard-output-port))
16
14
17
- (kl:global/shen.*platform-native-call-check*
18
- (lambda (fname )
19
- (and (symbol? fname)
20
- (let ((fname (symbol->string fname)))
21
- (and (>= (string-length fname) 4 )
22
- (char=? #\. (string-ref fname 3 ))
23
- (char=? #\s (string-ref fname 0 ))
24
- (char=? #\c (string-ref fname 1 ))
25
- (char=? #\m (string-ref fname 2 )))))))
26
-
27
15
(kl:_scm.initialize-compiler)
Original file line number Diff line number Diff line change 1
1
\* Copyright (c) 2012-2021 Bruno Deferrari. All rights reserved. *\
2
2
\* BSD 3-Clause License: http://opensource.org/licenses/BSD-3-Clause *\
3
3
4
- (define cd
5
- "" -> (cd (value shen.*initial-home-directory* ))
6
- Dir -> (let NewDir ((foreign scm.current-directory ) Dir )
7
- (set *home-directory* ((foreign scm.current-directory )))))
8
-
9
4
(define hash
10
5
Val Bound -> ((foreign scm.fxmod ) ((foreign scm.equal-hash ) Val ) Bound ))
11
6
91
86
\* read-file-as-* defined in prelude.scm *\
92
87
93
88
(define read-file-as-bytelist
94
- Filename -> ((foreign scm.read-file-as-bytelist ) Filename ))
95
-
96
- (define shen.read-file-as-charlist
97
- Filename -> ((foreign scm.read-file-as-bytelist ) Filename ))
89
+ Filename -> ((foreign scm.read-file-as-bytelist ) ((foreign scm.string-append ) (value *home-directory* ) Filename )))
98
90
99
91
(define read-file-as-string
100
- Filename -> ((foreign scm.read-file-as-string ) Filename ))
92
+ Filename -> ((foreign scm.read-file-as-string ) ((foreign scm.string-append ) (value *home-directory* ) Filename ) ))
101
93
102
94
\* tuples *\
103
95
Original file line number Diff line number Diff line change 122
122
; ; Streams and I/O
123
123
; ;
124
124
125
+ (define (with-home-directory filename )
126
+ (string-append (kl:value '*home-directory* ) filename))
127
+
125
128
(define (kl:open filename direction )
126
- (let ((full-path (full-path-for-file filename)))
129
+ (let ((full-path (full-path-for-file (with-home-directory filename) )))
127
130
(case direction
128
131
((in) (if (file-exists? full-path)
129
132
(open-binary-input-file full-path)
You can’t perform that action at this time.
0 commit comments