Skip to content

Commit 4d292d9

Browse files
committed
revised Preload for Julia v1.5 compatibility #32
1 parent a49f240 commit 4d292d9

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Reduce"
22
uuid = "93e0c654-6965-5f22-aba9-9c1ae6b3c259"
33
authors = ["Michael Reed"]
4-
version = "1.2.7"
4+
version = "1.2.8"
55

66
[deps]
77
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

src/Reduce.jl

+26-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,32 @@ function Load()
367367
return nothing
368368
end
369369

370-
Preload() = (global rs=PSL(); global s; eval(s); atexit(()->kill(rs)))
370+
function Preload()
371+
global rs=PSL()
372+
offs = ""
373+
for o in offlist
374+
global offs
375+
o != :nat && (offs = offs*"off $o; ")
376+
end
377+
write(rs.input,"off nat; $EOTstr;\n")
378+
banner = readuntil(rs.output,EOT) |> String
379+
readavailable(rs.output)
380+
rcsl = occursin(" CSL ",banner)
381+
if Sys.iswindows()
382+
banner = replace(banner,r"\r" => "")
383+
println(split(String(banner),'\n')[rcsl ? 1 : end-3])
384+
else
385+
ReduceCheck(banner)
386+
println(split(String(banner),'\n')[rcsl ? 1 : end-3])
387+
end
388+
load_package(:rlfi)
389+
offs |> RExpr |> rcall
390+
rcall(R"on savestructr")
391+
show(devnull,"text/latex",R"int(sinh(e**i*z),z)")
392+
R"x" == R"x"
393+
ListPrint(0)
394+
atexit(()->kill(rs))
395+
end
371396

372397
global preload = false
373398
try

0 commit comments

Comments
 (0)