;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: repl.lisp,v 1.1 2003/07/11 06:58:32 kevin Exp $
-;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; KMRCL users are granted the rights to distribute and use this software
(defclass repl ()
((listener :initarg :listener :accessor listener
- :initform nil)))
+ :initform nil)))
(defun make-repl (&key (port +default-repl-server-port+)
- announce user-checker remote-host-checker)
- (make-instance 'listener
+ announce user-checker remote-host-checker)
+ (make-instance 'listener
:port port
- :base-name "repl"
+ :base-name "repl"
:function 'repl-worker
:function-args (list user-checker announce)
:format :text
(finish-output conn)
(setq password (read-socket-line conn))
(unless (funcall user-checker login password)
- (format conn "Invalid login~%")
- (finish-output conn)
- (return-from repl-worker))))
+ (format conn "Invalid login~%")
+ (finish-output conn)
+ (return-from repl-worker))))
#+allegro
(tpl::start-interactive-top-level
conn
(defun read-socket-line (stream)
(string-right-trim-one-char #\return
- (read-line stream nil nil)))
+ (read-line stream nil nil)))
(defun print-prompt (stream)
(format stream "~&~A> " (package-name *package*))
(defun repl-on-stream (stream)
(let ((*standard-input* stream)
- (*standard-output* stream)
- (*terminal-io* stream)
- (*debug-io* stream))
+ (*standard-output* stream)
+ (*terminal-io* stream)
+ (*debug-io* stream))
#|
#+sbcl
(if (and (find-package 'sb-aclrepl)
- (fboundp (intern "REPL-FUN" "SB-ACLREPL")))
- (sb-aclrepl::repl-fun)
- (%repl))
+ (fboundp (intern "REPL-FUN" "SB-ACLREPL")))
+ (sb-aclrepl::repl-fun)
+ (%repl))
#-sbcl
|#
(%repl)))
(print-prompt *standard-output*)
(let ((form (read *standard-input*)))
(format *standard-output* "~&~S~%" (eval form)))))
-
+