Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (16 sloc) 0.604 kb
(require 'ffi)
(with-library (rl "libreadline")
(let ((ffi-readline (ffi:dlsym rl "readline"))
(ffi-add-history (ffi:dlsym rl "add_history")))
(define (readline prompt)
(let ((astr (ffi:funcall ffi-readline 'ffi-pointer prompt)))
(if (= (ffi:alien-to-int astr) 0)
""
(let ((str (ffi:alien-to-string astr)))
(ffi:funcall ffi-add-history 'ffi-void astr)
(ffi:free astr)
str))))))
(define (readline-repl)
"Provide a REPL with readline."
(display (eval (read-string (readline "bs+> "))))
(readline-repl))
Jump to Line
Something went wrong with that request. Please try again.