4 (in-package 'lisp-stat
)
7 ;;;; AKCL Top Level (Modified from AKCL source file unixport/kcltop.lsp)
11 (import '(si::*quit-tag
* si
::*eof
* si
::*lisp-initialized
*
12 si
::reset-stack-limits si
::break-current
))
26 (defun ls-top-level ()
27 (when (> (system:argc
) 1)
28 (setq system
:*system-directory
* (system:argv
1)))
29 (let ((lslib (si:getenv
"LSLIB")))
30 (if lslib
(setf *default-path
* lslib
)))
32 "AKCL (Austin Kyoto Common Lisp)~%~
33 Contains Enhancements by W. Schelter~%~
34 Lisp-Stat ~a, Copyright (c) by Luke Tierney, 1990~%~
35 Type :q to continue after an error~2%"
36 *common-lisp-stat-version
*)
37 (setq si
::*ihs-top
* 1)
39 (in-package 'system
::user
)
40 (incf system
::*ihs-top
* 2)
41 (let ((+ nil
) (++ nil
) (+++ nil
)
43 (* nil
) (** nil
) (*** nil
)
44 (/ nil
) (// nil
) (/// nil
))
45 (setq *lisp-initialized
* t
)
46 (catch *quit-tag
* (when (probe-file "init.lsp") (load "init.lsp")))
47 (catch *quit-tag
* (when (probe-file "statinit.lsp") (load "statinit.lsp")))
49 (setq +++ ++ ++ + + -
)
51 (if (eq *package
* (find-package 'user
))
53 (package-name *package
*)))
55 (when (catch *quit-tag
*
56 (setq -
(locally (declare (notinline read
))
57 (read *standard-input
* nil
*eof
*)))
58 (when (eq -
*eof
*) (bye))
59 (let ((values (multiple-value-list
60 (locally (declare (notinline eval
)) (eval -
)))))
61 (setq /// // // / / values
*** ** ** * * (car /))
64 (locally (declare (notinline prin1
)) (prin1 val
))
67 (terpri *error-output
*)
71 ;;;; Macintosh CL Top Level
72 ;;;; This does not quite properly work with the event loop of
78 (defun ls-init-top-level ()
80 (setf + nil
++ nil
+++ nil
85 "Lisp-Stat ~a, Copyright (c) by Luke Tierney, 1990~%~
86 Type COMMAND-. to continue after an error~2%"
87 *common-lisp-stat-version
*))
90 (defun ls-top-level ()
94 (setq +++ ++ ++ + + -
)
96 (if (eq *package
* (find-package 'cl-user
))
98 (package-name *package
*)))
99 (loop (if (listen *standard-input
*) (return t
))
101 (setq -
(locally (declare (notinline read
))
102 (read *standard-input
* t
)))
103 (if (consp -
) (read-line *standard-input
* t
))
105 (values (multiple-value-list
106 (locally (declare (notinline eval
)) (eval -
)))))
107 (setq /// // // / / values
*** ** ** * * (car /))
110 (locally (declare (notinline prin1
)) (prin1 val
))
116 ;;;; EXCL (Allegro) Top Level
120 (defun ls-top-level-eval (expr)
121 (setq +++ ++ ++ + + - - expr
)
122 (let ((values (multiple-value-list
123 (locally (declare (notinline eval
)) (eval -
)))))
124 (setq /// // // / / values
*** ** ** * * (car /))
128 (defun ls-top-level ()
130 "Lisp-Stat ~a, Copyright (c) by Luke Tierney, 1990~%~
131 Type :reset to continue after an error~2%"
132 *common-lisp-stat-version
*)
135 (let ((tpl:*eval
* 'ls-top-level-eval
)
136 (tpl:*prompt
* "<cls> ")
137 (*read-default-float-format
* *stat-float-type
*)
138 (+ nil
) (++ nil
) (+++ nil
)
140 (* nil
) (** nil
) (*** nil
)
141 (/ nil
) (// nil
) (/// nil
))
142 (catch '*ls-quit-tag
* (tpl:top-level-read-eval-print-loop
))))
145 (defun exit-ls () (throw '*ls-quit-tag
* nil
))