summaryrefslogtreecommitdiff
path: root/scheme/chez/geiser/geiser.ss
diff options
context:
space:
mode:
authorMaris Orbidans <maris.orbidans@onthemarket.com>2018-03-29 13:48:21 +0100
committerMaris Orbidans <maris.orbidans@onthemarket.com>2018-03-29 13:48:21 +0100
commit23bc15197dfed3773283b2cacbda47678635f22a (patch)
treef435e459d56cc52bb176a2f05396ede8c19cd408 /scheme/chez/geiser/geiser.ss
parentdb80a2219d6294dc8b5548cfb59890939ae83cd7 (diff)
downloadgeiser-guile-23bc15197dfed3773283b2cacbda47678635f22a.tar.gz
geiser-guile-23bc15197dfed3773283b2cacbda47678635f22a.tar.bz2
fix compile and load for chez
Diffstat (limited to 'scheme/chez/geiser/geiser.ss')
-rw-r--r--scheme/chez/geiser/geiser.ss17
1 files changed, 17 insertions, 0 deletions
diff --git a/scheme/chez/geiser/geiser.ss b/scheme/chez/geiser/geiser.ss
index 8b9aba7..38bc68f 100644
--- a/scheme/chez/geiser/geiser.ss
+++ b/scheme/chez/geiser/geiser.ss
@@ -4,9 +4,26 @@
geiser:module-completions
geiser:autodoc
geiser:no-values
+ geiser:load-file
geiser:newline)
(import (chezscheme))
+ (define (last-index-of str-list char idx last-idx)
+ (if (null? str-list)
+ last-idx
+ (last-index-of (cdr str-list) char (+ 1 idx) (if (char=? char (car str-list)) idx last-idx))))
+
+ (define (obj-file-name name)
+ (let ((idx (last-index-of (string->list name) #\. 0 -1)))
+ (if (= idx -1)
+ (string-append name ".so")
+ (string-append (substring name 0 idx) ".so"))))
+
+ (define (geiser:load-file filename)
+ (let ((output-filename (obj-file-name filename)))
+ (maybe-compile-file filename output-filename)
+ (load output-filename)))
+
(define string-prefix?
(lambda (x y)
(let ([n (string-length x)])