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
# 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]
function getKey()
raw_mode!(true)
- byte = readbytes(STDIN, 1)[1]
+ byte = read(STDIN, 1)[1]
raw_mode!(false)
if byte == 0x0d
if key == '\n'
print(" ")
- return AbstractString(line)
+ return String(line)
elseif key == '\x04'
if isempty(line)
i += 1
end
- println("\t", AbstractString(chars))
+ println("\t", String(chars))
end
end