aboutsummaryrefslogtreecommitdiff
path: root/process/step1_read_print.txt
blob: 3a0fd7c693adad114a6c02548ce64c9e8027b4e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- step1_read_print ----------------------------
import reader, printer

READ(str): return reader.read_str(str)

EVAL(ast,env): return ast

PRINT(exp): return printer.pr_str(exp)

rep(str): return PRINT(EVAL(READ(str),""))

main loop:
  try:      println(rep(readline("user> ")))
  catch e:  println("Error: ", e)