The Lambda Lab
/
projects
/
forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5039981
)
Slowly getting to grips with this.
author
Tim Vaughan
<tgvaughan@gmail.com>
Sat, 9 Apr 2016 10:43:24 +0000
(22:43 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Sat, 9 Apr 2016 10:43:24 +0000
(22:43 +1200)
src/forth.jl
patch
|
blob
|
history
diff --git
a/src/forth.jl
b/src/forth.jl
index
ca57e87
..
0aa33d7
100644
(file)
--- a/
src/forth.jl
+++ b/
src/forth.jl
@@
-4,13
+4,17
@@
RS = Array{Int64, 1}()
DS = Array{Int64, 1}()
primitives = Array{Expr,1}()
+memory = Array{Int,1}()
+headers = Array{Tuple{AbstractString, Int},1}
-
-
-type Definition
- name::AbstractString
- data::Array{Int64,1}
+function addPrim(name::AbstractString, expr::Expr)
+ push!(primitives, expr)
+ push!(memory, -length(primitives))
+ push!(headers, length(memory))
end
+addPrim("docol", :(begin
+
+end))
end