Current implementation of Refresh does not follows the official documentation of Wolfram Standard Library.
will results in just Now. To make it work we added extra argument:
this will work and reevaluate Now every second.
Problem
By the default, outside Mathematica the internal variable $FrontEnd is Null, which automatically resolve all Refresh[expr] to expr.
However all DownValues, UpValues of Refresh are empty (FormatValues do not count, Identity resolution happens even for InputForm). This means, Refresh is not constructed using default Wolfram Language syntax (or hidden on purpose).
Ok. Another way is to simply (that should not change anything normally if DownValues are empty)
Unprotect[Refresh];
ClearAll[Refresh];
Refresh /: MakeBoxes[Refresh[expr_], StandardForm] := "Hi there!";
This will nicely work. But what a surprise - now it breaks NeuralNet* package!
Our workaround
Then we do not clean all values, but only FormatValues:
Unprotect[Refresh];
FormatValues[Refresh] = {};
Refresh /: MakeBoxes[Refresh[expr_], StandardForm] := "Hi there!";
this will not work As we know, there is DownValues, that sets Refresh basically to Identity operator.
Since WLJS 2.5.0 and till now we still do it in a different way without affecting other internal packages:
Unprotect[Refresh];
FormatValues[Refresh] = {};
Refresh /: MakeBoxes[Refresh[expr_, period_?NumberQ], StandardForm] := ...our implementation;
Then this works now
Current implementation of
Refreshdoes not follows the official documentation of Wolfram Standard Library.will results in just
Now. To make it work we added extra argument:this will work and reevaluate
Nowevery second.Problem
By the default, outside Mathematica the internal variable
$FrontEndisNull, which automatically resolve allRefresh[expr]toexpr.However all
DownValues,UpValuesofRefreshare empty (FormatValuesdo not count,Identityresolution happens even forInputForm). This means,Refreshis not constructed using default Wolfram Language syntax (or hidden on purpose).Ok. Another way is to simply (that should not change anything normally if
DownValuesare empty)This will nicely work. But what a surprise - now it breaks
NeuralNet*package!Our workaround
Then we do not clean all values, but only
FormatValues:this will not work As we know, there is
DownValues, that setsRefreshbasically toIdentityoperator.Since WLJS 2.5.0 and till now we still do it in a different way without affecting other internal packages:
Then this works now