X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=forth.jl.git;a=blobdiff_plain;f=src%2Fforth.jl;h=4c81dc35b59f305078a7a2a08f4e95927b640b8b;hp=947aafbfce8509c975ccbdad09ba555666388e42;hb=2de79279a0f7157a41c0f32674ba96f56cb1b02f;hpb=d3205350a0b5935ac26e154750f5916ebbeebae3 diff --git a/src/forth.jl b/src/forth.jl index 947aafb..4c81dc3 100644 --- a/src/forth.jl +++ b/src/forth.jl @@ -1,6 +1,6 @@ module forth -import Base.REPLCompletions +import Base.REPLCompletions, Base.invokelatest # VM mem size size_mem = 1000000 # 1 mega-int @@ -123,7 +123,7 @@ function callPrim(addr::Int64) if addr >=0 || -addr>length(primitives) error("Attempted to execute non-existent primitive at address $addr.") else - primitives[-addr]() + invokelatest(primitives[-addr]) end end getPrimName(addr::Int64) = primNames[-addr]