Add TODO comment

This commit is contained in:
cc-wr 2020-01-16 06:28:16 -05:00
parent 5f6f6363f0
commit 66a03632cc

View File

@ -66,6 +66,36 @@ If[
uninteract[expr_] := UsingFrontEnd[applyHook[$Pre, expr]];
SetAttributes[uninteract, HoldAll];
(************************************
version of Print that
sends output to Jupyter
*************************************)
(* redirect Print calls into a message to Jupyter, in order to print in Jupyter *)
(* TODO: review other methods: through EvaluationData or WSTP so we don't redefine Print *)
(* TODO: remove this and just permanently set $Output to {..., loopState["WolframLanguageForJupyter-stdout"], ...} *)
Unprotect[Print];
Print[ourArgs___, opts:OptionsPattern[]] :=
Block[
{
$inPrint = True,
$Output
},
If[
loopState["printFunction"] =!= False,
$Output = {OpenWrite[FormatType -> OutputForm]};
If[
!FailureQ[First[$Output]],
Print[ourArgs, opts];
loopState["printFunction"][
Import[$Output[[1,1]], "String"]
];
Close[First[$Output]];
];
];
] /; !TrueQ[$inPrint];
Protect[Print];
(************************************
version of Write that
sends output to Jupyter
@ -136,35 +166,6 @@ If[
] /; !TrueQ[$inWriteString];
Protect[WriteString];
(************************************
version of Print that
sends output to Jupyter
*************************************)
(* redirect Print calls into a message to Jupyter, in order to print in Jupyter *)
(* TODO: review other methods: through EvaluationData or WSTP so we don't redefine Print *)
Unprotect[Print];
Print[ourArgs___, opts:OptionsPattern[]] :=
Block[
{
$inPrint = True,
$Output
},
If[
loopState["printFunction"] =!= False,
$Output = {OpenWrite[FormatType -> OutputForm]};
If[
!FailureQ[First[$Output]],
Print[ourArgs, opts];
loopState["printFunction"][
Import[$Output[[1,1]], "String"]
];
Close[First[$Output]];
];
];
] /; !TrueQ[$inPrint];
Protect[Print];
(************************************
versions of Quit and Exit that
ask the Jupyter console