Mercurial > core / lisp/lib/cli/repl.lisp
changeset 698: |
96958d3eb5b0 |
parent: |
66059a1117bd
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
1 ;;; lib/cli/repl.lisp --- REPL utils 6 ;; *command-char* alias make-repl-fun 9 ;; this should be used as a light layer on top of the standard Lisp 10 ;; REPL provided by SBCL. Basically whenever we're typing input 11 ;; destined for a Lisp reader this is our best bet. 12 (defun load-acl-repl () 13 "Load the SB-ACLREPL package, applying changes to the default SBCL 15 (require 'sb-aclrepl)) 17 ;;; Readline-style REPL 18 ;; this is suited for non-Lisp input which should skip the Lisp 19 ;; reader. Input is interpreted as strings and handled by the GNU 20 ;; Readline library via FFI. Features include History, Custom 21 ;; Functions, and Custom Keybinds (not available in ACLREPL above). 22 (defun input-novelty-check (x y) 27 (defun start-rl-repl () 28 "Start a GNU Readline REPL." 31 ((string= "quit" (trim input))) 32 (setf input (readline :prompt (format nil "[~a]> " i) 34 :novelty-check #'input-novelty-check))))