From a8d6c9e31d8bef0714bc91f188cb944a147e2f3c Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Sat, 9 Apr 2016 22:43:24 +1200 Subject: [PATCH] Slowly getting to grips with this. --- src/forth.jl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 -- 2.20.1