From ef54433308b352a75aeb6026da1795495d61860c Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Tue, 17 Jan 2017 21:27:08 +1300 Subject: [PATCH] Made forth.jl compatible with julia 0.5. --- README.md | 3 +++ REQUIRE | 2 +- src/forth.jl | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 54dd58b..123f3c4 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,9 @@ 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.) + ## Usage To start the interpreter/compiler running, simply enter the following at diff --git a/REQUIRE b/REQUIRE index d5d6467..94237c0 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1 +1 @@ -julia 0.4 +julia 0.5 diff --git a/src/forth.jl b/src/forth.jl index 81505a1..e391d00 100644 --- a/src/forth.jl +++ b/src/forth.jl @@ -97,7 +97,7 @@ end # Handy functions for adding/retrieving strings to/from memory. -getString(addr::Int64, len::Int64) = AbstractString([Char(c) for c in mem[addr:(addr+len-1)]]) +getString(addr::Int64, len::Int64) = String([Char(c) for c in mem[addr:(addr+len-1)]]) function putString(str::AbstractString, addr::Int64) mem[addr:(addr+length(str)-1)] = [Int64(c) for c in str] @@ -708,7 +708,7 @@ end function getKey() raw_mode!(true) - byte = readbytes(STDIN, 1)[1] + byte = read(STDIN, 1)[1] raw_mode!(false) if byte == 0x0d @@ -750,7 +750,7 @@ function getLineFromSTDIN() if key == '\n' print(" ") - return AbstractString(line) + return String(line) elseif key == '\x04' if isempty(line) @@ -1370,7 +1370,7 @@ function dump(startAddr::Int64; count::Int64 = 100, cellsPerLine::Int64 = 10) i += 1 end - println("\t", AbstractString(chars)) + println("\t", String(chars)) end end -- 2.20.1