diff --git a/README.md b/README.md index 88eac34..7fdf1cf 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,7 @@ into `$PREFIX/bin`, with the environment variable `PREFIX` defaulting to `sbcli` depends on [alexandria(https://common-lisp.net/project/alexandria/], [cl-str](https://github.com/vindarel/cl-str) and [cl-readline](https://github.com/mrkkrp/cl-readline). If you have [Quicklisp](http://quicklisp.org/) -installed, all the dependencies will be installed on `sbcli`s first launch. `sbcli` -assumes that Quicklisp is installed under `~/quicklisp`. +installed, all the dependencies will be installed on `sbcli`s first launch. ## Usage @@ -77,6 +76,9 @@ For reference, here is a complete list of the variables we expose: ; the return value prompt *ret* ; => "=> " +; the path of quicklisp setup +*quicklisp* ; => "~/quicklisp/setup" + ; where to store the history *hist-file* ; => "~/.sbcli_history" diff --git a/repl.lisp b/repl.lisp index 8777233..0485913 100755 --- a/repl.lisp +++ b/repl.lisp @@ -1,5 +1,22 @@ #!/usr/bin/env -S sbcl --script -(load "~/quicklisp/setup") + +(defvar *repl-version* "0.1.4") +(defvar *repl-name* "Veit's REPL for SBCL") +(defvar *prompt* "sbcl> ") +(defvar *prompt2* "....> ") +(defvar *ret* "=> ") +(defvar *quicklisp* "~/quicklisp/setup") +(defvar *config-file* "~/.sbclirc") +(defvar *hist-file* "~/.sbcli_history") +(defvar *hist* (list)) +(defvar *pygmentize* nil) +(defvar *pygmentize-options* (list "-s" "-l" "lisp")) +(defvar *error* nil) + +(if (probe-file *config-file*) + (load *config-file*)) + +(load *quicklisp*) (let ((*standard-output* (make-broadcast-stream))) (ql:quickload "alexandria") @@ -10,7 +27,7 @@ (defpackage :sbcli (:use :common-lisp :cffi) - (:export sbcli *repl-version* *repl-name* *prompt* *prompt2* *ret* *config-file* + (:export sbcli *repl-version* *repl-name* *prompt* *prompt2* *ret* *config-file* *quicklisp* *hist-file* *special* *error*)) (defpackage :sbcli-user @@ -417,9 +434,6 @@ strings to match candidates against (for example in the form \"package:sym\")." (rl:register-function :redisplay #'syntax-hl) (sbcli "" *prompt*))) -(if (probe-file *config-file*) - (load *config-file*)) - (format t "~a version ~a~%" *repl-name* *repl-version*) (write-line "Press CTRL-D or type :q to exit") (write-char #\linefeed)