diff --git a/contrib/10.readline/example/simple-repl.scm b/contrib/10.readline/example/simple-repl.scm new file mode 100644 index 00000000..085e992c --- /dev/null +++ b/contrib/10.readline/example/simple-repl.scm @@ -0,0 +1,15 @@ +(import (scheme base) + (scheme read) + (scheme eval) + (scheme write) + (picrin readline) + (picrin readline history)) +(let loop ((n 1)) + (let ((input (readline "> "))) + (if (eof-object? input) + (newline) + (begin + (add-history input) + (write (eval (read (open-input-string input)) '(picrin user))) + (newline) + (loop 1))))) diff --git a/contrib/10.readline/t/test.scm b/contrib/10.readline/t/test.scm index 227a85b0..2fb65181 100644 --- a/contrib/10.readline/t/test.scm +++ b/contrib/10.readline/t/test.scm @@ -1,23 +1,6 @@ (import (scheme base) - (scheme read) - (scheme eval) - (scheme write) - (picrin readline) (picrin readline history) (picrin test)) - - -;; (let loop ((n 1)) -;; (let ((input (readline "> "))) -;; (if (eof-object? input) -;; (newline) -;; (begin -;; (add-history input) -;; (write (eval (read (open-input-string input)) '(picrin user))) -;; (newline) -;; (loop 1))))) - -;; (readline "prompt") (define testfile "picrin_readline_test_file") (test-begin)