Runtime evaluation: Difference between revisions

(Frink)
Line 383:
</lang>
 
There is also a two-argument version, <CODE>eval[expression, rethrows]</CODE> where the <CODE>rethrows</CODE> argument is a boolean flag indicating if we want evaluation errors to be thrown or just suppressed and <CODE>undef</CODE> returned. If it is true, errors will be rethrown as Java exceptions, otherwise an error returns undef.
Frink has an extensive security manager which allows the eval statements to prevent unsecure operations such as reading or writing a file or URL, creating new functions or classes, altering systemwide flags, evaluate arbitrary Java code, and so on. If code needs to evaluate unsecure statments, you can use the intentionally frighteningly-named <CODE>unsafeEval[str]</CODE>.
 
There is also a three-argument version, <CODE>eval[expression, rethrows, hidesLocals]</CODE> where the <CODE>hidesLocal</CODE> argument is a boolean flag indicating if we want to hide local variables (that is, create a new context) before evaluation.
 
Frink has an extensive security manager which allows the eval statementsstatement to prevent unsecure operations such as reading or writing a file or URL, creating new functions or classes, altering systemwide flags, evaluate arbitrary Java code, and so on. If code needs to evaluate unsecure statments, you can use the intentionally frighteningly-named <CODE>unsafeEval[str]</CODE>.
 
=={{header|Go}}==
494

edits