From ea18e545173cd72a7a7e8162409f0ad94d690056 Mon Sep 17 00:00:00 2001 From: "Sunrim KIM (keen)" <3han5chou7@gmail.com> Date: Sat, 9 Aug 2014 15:09:21 +0900 Subject: [PATCH] separate example from test --- contrib/10.readline/example/simple-repl.scm | 15 +++++++++++++++ contrib/10.readline/t/test.scm | 17 ----------------- 2 files changed, 15 insertions(+), 17 deletions(-) create mode 100644 contrib/10.readline/example/simple-repl.scm 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)