Skip to content

Commit

Permalink
revised Preload for Julia v1.5 compatibility #32
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed Aug 7, 2020
1 parent a49f240 commit 4d292d9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
@@ -1,7 +1,7 @@
name = "Reduce"
uuid = "93e0c654-6965-5f22-aba9-9c1ae6b3c259"
authors = ["Michael Reed"]
version = "1.2.7"
version = "1.2.8"

[deps]
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Expand Down
27 changes: 26 additions & 1 deletion src/Reduce.jl
Expand Up @@ -367,7 +367,32 @@ function Load()
return nothing
end

Preload() = (global rs=PSL(); global s; eval(s); atexit(()->kill(rs)))
function Preload()
global rs=PSL()
offs = ""
for o in offlist
global offs
o != :nat && (offs = offs*"off $o; ")
end
write(rs.input,"off nat; $EOTstr;\n")
banner = readuntil(rs.output,EOT) |> String
readavailable(rs.output)
rcsl = occursin(" CSL ",banner)
if Sys.iswindows()
banner = replace(banner,r"\r" => "")
println(split(String(banner),'\n')[rcsl ? 1 : end-3])
else
ReduceCheck(banner)
println(split(String(banner),'\n')[rcsl ? 1 : end-3])
end
load_package(:rlfi)
offs |> RExpr |> rcall
rcall(R"on savestructr")
show(devnull,"text/latex",R"int(sinh(e**i*z),z)")
R"x" == R"x"
ListPrint(0)
atexit(()->kill(rs))
end

global preload = false
try
Expand Down

0 comments on commit 4d292d9

Please sign in to comment.