+REPL prompt fixed for SBCL
[lineal.git] / src / shell / main.lisp
blobf66869b1806773b3bc1a7024402cebc8f2cd84ce
2 (defpackage :lineal.shell
3 (:use :cl :lineal :lineal.overload))
4 (in-package :lineal.shell)
6 (defun greeting (infixp)
7 (format t "~&Welcome to Lineal, ")
8 (format t "using ~:[prefix~;infix~] notation." infixp)
9 (format t "~%To leave, use exit or quit.")
10 (format t "~%> ")
11 (force-output))
13 ;;; Main loop for shell.
14 (defun shell-repl ()
15 (let ((infixp (symbol-value
16 'lineal.devvars::use-infix-p)))
17 (greeting infixp)
18 (handler-case
19 (do ((str (read-line) (read-line)))
20 ((or (string= "quit" str)
21 (string= "exit" str)))
22 (over-format
23 (process-input-from-string
24 str infixp)
25 *standard-output*)
26 (format t "~&> ")
27 (force-output))
28 (end-of-file (condit)
29 (declare (ignore condit))))))