diff options
author | Maris Orbidans <maris.orbidans@onthemarket.com> | 2018-03-29 13:48:21 +0100 |
---|---|---|
committer | Maris Orbidans <maris.orbidans@onthemarket.com> | 2018-03-29 13:48:21 +0100 |
commit | a5a617648a445ff323bc7c832786769782d8c45c (patch) | |
tree | bfa20dce6363e1adfa0b0b49962342f4f54b8dbd | |
parent | 6eb6a92d5178e73c5097e9166b29a6b88910c823 (diff) | |
download | geiser-chez-a5a617648a445ff323bc7c832786769782d8c45c.tar.gz geiser-chez-a5a617648a445ff323bc7c832786769782d8c45c.tar.bz2 |
fix compile and load for chez
-rw-r--r-- | elisp/geiser-chez.el | 2 | ||||
-rw-r--r-- | scheme/chez/geiser/geiser.ss | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/elisp/geiser-chez.el b/elisp/geiser-chez.el index 2bd45f1..ff75e5a 100644 --- a/elisp/geiser-chez.el +++ b/elisp/geiser-chez.el @@ -104,7 +104,7 @@ This function uses `geiser-chez-init-file' if it exists." (geiser-eval--send/wait "(begin (import (geiser)) (write `((result ) (output . \"\"))) (newline))"))) (defun geiser-chez--display-error (module key msg) - (and key (message key) nil)) + (and key (message msg) nil)) ;;; Implementation definition: 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)]) |