HCoop
/
jackhill
/
mal.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d90e2c8
)
Julia: step0
author
Joel Martin
<github@martintribe.org>
Sat, 28 Mar 2015 20:10:32 +0000
(15:10 -0500)
committer
Joel Martin
<github@martintribe.org>
Wed, 1 Apr 2015 04:04:42 +0000
(23:04 -0500)
julia/step0_repl.jl
[new file with mode: 0755]
patch
|
blob
diff --git a/julia/step0_repl.jl
b/julia/step0_repl.jl
new file mode 100755
(executable)
index 0000000..
7e61105
--- /dev/null
+++ b/
julia/step0_repl.jl
@@ -0,0
+1,32
@@
+#!/usr/bin/env julia
+
+# READ
+function READ(str)
+ str
+end
+
+# EVAL
+function EVAL(ast, env)
+ ast
+end
+
+# PRINT
+function PRINT(exp)
+ exp
+end
+
+# REPL
+function REP(str)
+ return PRINT(EVAL(READ(str), {}))
+end
+
+while true
+ print("user> ")
+ flush(STDOUT)
+ line = readline(STDIN)
+ if line == ""
+ break
+ end
+ line = chomp(line)
+ println(REP(line))
+end