[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get a useful repl with Chicken 5?

From: Matt Welland
Subject: How to get a useful repl with Chicken 5?
Date: Thu, 30 Jan 2020 11:01:21 -0700

Line editing and saving history make using a repl much more productive for me. With chicken 4 I was able to get a useful repl with something like this sequence of calls:

(import extras) ;; might not be needed?
(import readline)
(import apropos)
;; my imports here ...
(install-history-file (get-environment-variable "HOME") ".some_history")
(current-input-port (make-readline-port "someprog> "))

I've tried linenoise but don't see how to save the history:

(import linenoise)
(set-history-length! 300)
(load-history-from-file historyf)
(current-input-port (make-linenoise-port))
;; (save-history-to-file historyf) ;; doesn't work :(

I've read the docs on linenoise and breadline but I'm not seeing how to get a useful editable repl.

Any pointers or suggestions would be appreciated.
Complexity is your enemy. Any fool can make something complicated.
It is hard to keep things simple. - Richard Branson.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]