From: Tim Vaughan Date: Sat, 9 Apr 2016 10:43:24 +0000 (+1200) Subject: Slowly getting to grips with this. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=a8d6c9e31d8bef0714bc91f188cb944a147e2f3c;p=forth.jl.git Slowly getting to grips with this. --- diff --git a/src/forth.jl b/src/forth.jl index ca57e87..0aa33d7 100644 --- 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