checkImplicitResult method
Helper method that checks whether we have a new implicit result, and if so, invokes the implicitOutput callback (if any). This is how you can see the result of an expression in a Read-Eval-Print Loop (REPL).
Implementation
void checkImplicitResult(int previousImpResultCount) {
if (implicitOutput != null &&
vm!.globalContext!.implicitResultCounter > previousImpResultCount) {
Value? result =
vm!.globalContext!.getVar(ValVar.implicitResult.identifier);
implicitOutput!(result!.toStringWithVM(vm!), true);
}
}