Navigation
Synopsis Evaluate a (list of) Rascal commands and return the type of the last command.
Function
  1. str evalType(str command) throws Timeout, StaticError, ParseError
  2. str evalType(list[str] commands) throws Timeout, StaticError, ParseError
  3. str evalType(str command, int duration) throws Timeout, StaticError, ParseError
  4. str evalType(list[str] commands, int duration) throws Timeout, StaticError, ParseError
Usage import util::Eval;
Description Evaluate a command or a list of commands and return the type of the value of the last command that is executed. An optional duration argument may be present to limit the time (in milliseconds) the execution may take. By default, the duration is set to 1000 ms.
Examples
rascal>import util::Eval;
ok
rascal>evalType("2 * 3;");
str: "int"
rascal>evalType("[1, 2, 3];");
str: "list[int]"
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.