HCoop
/
jackhill
/
mal.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Merge pull request #377 from asarhaddon/fix-runtests-pre-eval
[jackhill/mal.git]
/
scheme
/
step0_repl.scm
1
(import (scheme base))
2
(import (scheme write))
3
4
(define (READ input)
5
input)
6
7
(define (EVAL input)
8
input)
9
10
(define (PRINT input)
11
input)
12
13
(define (rep input)
14
(PRINT (EVAL (READ input))))
15
16
(define (readline prompt)
17
(display prompt)
18
(flush-output-port)
19
(let ((input (read-line)))
20
(if (eof-object? input)
21
#f
22
input)))
23
24
(define (main)
25
(let loop ()
26
(let ((input (readline "user> ")))
27
(when input
28
(display (rep input))
29
(newline)
30
(loop))))
31
(newline))
32
33
(main)