Skip to content

Commit

Permalink
Remove cd override
Browse files Browse the repository at this point in the history
  • Loading branch information
tizoc committed Jun 2, 2024
1 parent 89f4874 commit d452d08
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 deletions.
1 change: 0 additions & 1 deletion src/compiler.shen
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
(set *static-globals* [
shen.*infs* shen.*call* shen.*occurs*
shen.*special* shen.*extraspecial*
shen.*platform-native-call-check*
shen.*demodulation-function*
shen.*gensym*
*stinput* *stoutput* *sterror*
Expand Down
12 changes: 0 additions & 12 deletions src/init.scm
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,11 @@
(kl:set '*implementation* "chez-scheme")
(kl:set '*release* (call-with-values scheme-version-number (lambda (major minor patch) (format "~s.~s.~s" major minor patch))))
(kl:set '*porters* "Bruno Deferrari")
(kl:set '*home-directory* (current-directory))
(kl:set 'shen.*initial-home-directory* (current-directory))

(register-globals)

(kl:global/*sterror* (standard-error-port))
(kl:global/*stinput* (standard-input-port))
(kl:global/*stoutput* (standard-output-port))

(kl:global/shen.*platform-native-call-check*
(lambda (fname)
(and (symbol? fname)
(let ((fname (symbol->string fname)))
(and (>= (string-length fname) 4)
(char=? #\. (string-ref fname 3))
(char=? #\s (string-ref fname 0))
(char=? #\c (string-ref fname 1))
(char=? #\m (string-ref fname 2)))))))

(kl:_scm.initialize-compiler)
12 changes: 2 additions & 10 deletions src/overrides.shen
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
\* Copyright (c) 2012-2021 Bruno Deferrari. All rights reserved. *\
\* BSD 3-Clause License: http://opensource.org/licenses/BSD-3-Clause *\

(define cd
"" -> (cd (value shen.*initial-home-directory*))
Dir -> (let NewDir ((foreign scm.current-directory) Dir)
(set *home-directory* ((foreign scm.current-directory)))))

(define hash
Val Bound -> ((foreign scm.fxmod) ((foreign scm.equal-hash) Val) Bound))

Expand Down Expand Up @@ -91,13 +86,10 @@
\* read-file-as-* defined in prelude.scm *\

(define read-file-as-bytelist
Filename -> ((foreign scm.read-file-as-bytelist) Filename))

(define shen.read-file-as-charlist
Filename -> ((foreign scm.read-file-as-bytelist) Filename))
Filename -> ((foreign scm.read-file-as-bytelist) ((foreign scm.string-append) (value *home-directory*) Filename)))

(define read-file-as-string
Filename -> ((foreign scm.read-file-as-string) Filename))
Filename -> ((foreign scm.read-file-as-string) ((foreign scm.string-append) (value *home-directory*) Filename)))

\* tuples *\

Expand Down
5 changes: 4 additions & 1 deletion src/primitives.scm
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,11 @@
;; Streams and I/O
;;

(define (with-home-directory filename)
(string-append (kl:value '*home-directory*) filename))

(define (kl:open filename direction)
(let ((full-path (full-path-for-file filename)))
(let ((full-path (full-path-for-file (with-home-directory filename))))
(case direction
((in) (if (file-exists? full-path)
(open-binary-input-file full-path)
Expand Down

0 comments on commit d452d08

Please sign in to comment.