Added eval of general scheme code and added exit proc.

master 1
Thomas Hintz 14 years ago
parent 1a5c645c09
commit 6f34ac231d

@ -4,11 +4,26 @@
(gnu-history-install-file-manager (string-append (or (getenv "HOME") ".") "/.csi.history"))
(repl-prompt (lambda () "$ "))
(define config-file (make-parameter (string-append (or (getenv "HOME") ".") "/.hintz-shellrc")))
(when (file-exists? (config-file))
(load (config-file)))
(define exit? (make-parameter #f))
(define (exit) (exit? #t))
(define (shell-repl)
(let ((x (read)))
(if (eq? x 'exit)
(if (exit?)
#t
(begin (execute (list x))
(let ((x (read)))
(begin (handle-exceptions
exn
(handle-exceptions
exn
(begin (print-error-message exn)
(display (with-output-to-string (lambda () (print-call-chain)))))
(execute (list x)))
(display (eval x))
(newline))
(newline)
(shell-repl)))))

Loading…
Cancel
Save