Skip to content

Instantly share code, notes, and snippets.

@onslauth
Created March 28, 2014 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onslauth/9826915 to your computer and use it in GitHub Desktop.
Save onslauth/9826915 to your computer and use it in GitHub Desktop.
Bash example:
-------------
$ read -e -p '> ' -i 'default' a
> default
$ echo $a
default
guile example:
--------------
scheme@(guile-user)> (use-modules (ice-9 readline))
scheme@(guile-user)> (define (f text state) (if state #f "WENDY"))
scheme@(guile-user)> (with-readline-completion-function f (λ () (let ((x (readline "> "))) (format #t "you entered ~s\n" x))))
> WENDY
you entered "WENDY "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment