diff --git a/src/compiler.shen b/src/compiler.shen index bd906bd..68820e5 100644 --- a/src/compiler.shen +++ b/src/compiler.shen @@ -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* diff --git a/src/init.scm b/src/init.scm index a80df0a..6c4908f 100644 --- a/src/init.scm +++ b/src/init.scm @@ -5,8 +5,6 @@ (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) @@ -14,14 +12,4 @@ (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) diff --git a/src/overrides.shen b/src/overrides.shen index 42e4787..53142e1 100644 --- a/src/overrides.shen +++ b/src/overrides.shen @@ -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)) @@ -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 *\ diff --git a/src/primitives.scm b/src/primitives.scm index 2db3ce3..fc89bac 100644 --- a/src/primitives.scm +++ b/src/primitives.scm @@ -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)