Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose quicklisp location to user #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"

Expand Down
24 changes: 19 additions & 5 deletions repl.lisp
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down