From: Tim Vaughan Date: Thu, 10 Aug 2017 20:18:33 +0000 (+0200) Subject: Used invokelatest to work around world age issue. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=2de79279a0f7157a41c0f32674ba96f56cb1b02f;p=forth.jl.git Used invokelatest to work around world age issue. --- diff --git a/README.md b/README.md index 123f3c4..6f30a15 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ install it, you will therefore need to use the following command: julia> Pkg.clone("https://github.com/tgvaughan/forth.jl") -Currently, forth.jl **requires** Julia 0.5. (Incompatabilities between 0.4 and 0.5 -mean that I cannot support both versions.) +Currently, forth.jl **requires** Julia 0.6. (Incompatabilities exist between +0.6 and previous versions of julia, particularly the handling of [world age](https://github.com/JuliaLang/julia/pull/17057).) ## Usage 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]