historyclisp

Is it possible to have a bash-like command history for the clisp interpreter?


I use the GNU CLISP 2.49 Interpreter. When I start evaluating expressions I may cycle through them with the up and down arrow keys. However, when I quit and restart, none of them are available. Is there a way to have a command-history across sessions within CLISP?


Solution

  • See Advanced Readline and History Functionality and examples:

    (defparameter *history-file* "readline-history-file")
    (readline:write-history *history-file*)            
    (readline:append-history 1000 *history-file*)      
    (readline:read-history *history-file*)            
    (readline:read-history-range *history-file* 0 -1)  
    (readline:history-truncate-file *history-file* 10)