Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid unnecessary uses of EvalString #61

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gap/helpers.gi
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ InstallGlobalFunction(WordGrowth, function(arg)
if IsString(draw) then
AppendTo(draw,S);
else
if IsBound(JupyterRenderable) then
return EvalString("JupyterRenderable")(rec(("image/svg+xml") :=IO_PipeThrough("dot",["-Tsvg"],S)),rec());
if IsBoundGlobal("JupyterRenderable") then
return ValueGlobal("JupyterRenderable")(rec(("image/svg+xml") :=IO_PipeThrough("dot",["-Tsvg"],S)),rec());
else
DOT2DISPLAY@(S, "neato");
fi;
Expand All @@ -498,7 +498,7 @@ end);
InstallOtherMethod(Draw, "(FR) default",
[IsObject],
function(l)
if IsBound(JupyterRenderable) then
if IsBoundGlobal("JupyterRenderable") then
return WordGrowth(l,rec(draw:=true));
else
WordGrowth(l,rec(draw:=true));
Expand All @@ -516,7 +516,7 @@ InstallOtherMethod(Draw, "(FR) default, with options",
function(l,options)
options := ShallowCopy(options);
options.draw := true;
if IsBound(JupyterRenderable) then # a hack
if IsBoundGlobal("JupyterRenderable") then # a hack
return WordGrowth(l,options);
else
WordGrowth(l,options);
Expand Down
4 changes: 2 additions & 2 deletions gap/mealy.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@ end);

BindGlobal("DRAWMEALY@", function(M)
# more a hack than a clean implementation...
if IsBound(JupyterRenderable) then
return EvalString("JupyterRenderable")(rec(("image/svg+xml") :=IO_PipeThrough("dot",["-Tsvg"],MM2DOT@(M))),rec());
if IsBoundGlobal("JupyterRenderable") then
return ValueGlobal("JupyterRenderable")(rec(("image/svg+xml") :=IO_PipeThrough("dot",["-Tsvg"],MM2DOT@(M))),rec());
else
DOT2DISPLAY@(MM2DOT@(M),"dot");
fi;
Expand Down