You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps we should just print this captured stdout? Or perhaps we should implement GAP.evalstr differently. Right now it is implemented using GAP_EvalString which in turn invokes READ_ALL_COMMANDS(instream, False, True, viewObjFunc); -- the first False turns off echo mode; perhaps we should directly invoke GAP.Globals.READ_ALL_COMMANDS, e.g.
functionmyevalstr(s::String)
input = GAP.Globals.InputTextString(GAP.Obj(s))
view = GAP.Globals.EvalString(g"function(x) ViewObj(x); Print(\"\\n\"); end")
res = GAP.Globals.READ_ALL_COMMANDS(input, true, false, view);
end
I guess it also depends a bit on the desired semantics... Which we should decide on and document more carefully?
The text was updated successfully, but these errors were encountered:
It really depends on what we want to achieve. Concerning GAP.evalstr("Display(1);"), GAP's Display has no return value, just a side effect, hence GAP.evalstr returns nothing.
GAP.evalstr_ex covers both aspects, return value and output, like in the following example.
Consider this:
There is no output because
GAP.evalstr
is currently implemented usingGAP.evalstr_ex
, which deliberately redirects GAP's stdout into a string:Perhaps we should just print this captured stdout? Or perhaps we should implement
GAP.evalstr
differently. Right now it is implemented usingGAP_EvalString
which in turn invokesREAD_ALL_COMMANDS(instream, False, True, viewObjFunc);
-- the firstFalse
turns off echo mode; perhaps we should directly invokeGAP.Globals.READ_ALL_COMMANDS
, e.g.I guess it also depends a bit on the desired semantics... Which we should decide on and document more carefully?
The text was updated successfully, but these errors were encountered: