Which command could be used to clear screen in CLISP?
Such as cls for cmd.exe. It's very 开发者_StackOverflow社区annoy if I can't do this.
You can use screen:clear-window
to do this:
(screen:with-window (screen:clear-window screen:*window*))
For more information see the documentation on screen. Also note that these functions are specific to clisp.
That didn't work for me but this did (acquired from the link)
(screen:clear-window (screen:make-window))
if you are running clisp inside emacs
C-c M-o
which of course is
Control-C Alt-o -or-
Control-C Meta-o
this is the default keybinding to call "clear buffer" from the "repl" menu.
Depending on what terminal you're using(support for ANSI control sequences, for example on most *nix), you could try:
(defun cls()
(format t "~A[H~@*~A[J" #\escape))
Then call it:
(cls)
CLISP UNDER WINDOWS
(ext:run-shell-command "cls")
(defun cls () (ext:run-shell-command "cls") )
then write in the repl
(cls) and voila
(loop for x from 1 to 1400
do (princ " ")
)
Nilambar this is for clisp 2.49 running under windows
When you are learning like me make a lot of test, try, error, abort etc and screen of repl or interpreter its a pigsty of that trys and its difficult to beginer to found the results to new trys then you type (ext:run-shell-comand "cls") and the repl clean it screen and the prompt go to upper left corner.
精彩评论