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 #174 from dubek/issue_166_schemes
[jackhill/mal.git]
/
racket
/
step0_repl.rkt
1
#!/usr/bin/env racket
2
#lang racket
3
4
(require "readline.rkt" "types.rkt")
5
6
;; read
7
(define (READ str)
8
str)
9
10
;; eval
11
(define (EVAL ast env)
12
ast)
13
14
;; print
15
(define (PRINT exp)
16
exp)
17
18
;; repl
19
(define (rep str)
20
(PRINT (EVAL (READ str) "")))
21
22
(define (repl-loop)
23
(let ([line (readline "user> ")])
24
(when (not (eq? nil line))
25
(printf "~a~n" (rep line))
26
(repl-loop))))
27
(repl-loop)