|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
#!/usr/bin/env lua50
-- (find-lua50ref "os.getenv")
-- (eev "ln -sf ../LFORTH/lforth ~/bin/lforth")
-- (find-fline "~/LFORTH/")
-- (find-angg "LFORTH/stdlib.lua" "envsubst")
setenv("LFORTH", getenv("LFORTH") or envsubst("$HOME/LFORTH"))
assert(loadfile(envsubst("$LFORTH/kernel.lua")))()
-- (find-angg "LFORTH/kernel.lua")
fload = function (fname) interpret(readfile(envsubst(fname))) end
fload("$LFORTH/stdlib.lforth")
dict_interpreter["fload"] = function () fload(getword()) end
if arg[1] then
if string.find(arg[1], " ") then -- hack: if arg[1] has a space
interpret(arg[1]) -- then interpret it
else
fload(arg[1]) -- else fload it
end
else
print("Where's my arg[1]?")
end
-- (eev "lforth '5 2 * .'")
-- (find-es "lua5" "build-simple")
-- (find-es "lua5" "build")
-- for i=0,arg.n