Add TextWriter, IOException, per-VM module data and pre-load imports; Add console module with Console class
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'console';
|
||||
class Operations {
|
||||
|
||||
public callback ops(int $x, int $y, string $op){
|
||||
@@ -26,11 +27,11 @@ class Program {
|
||||
callback $fn;
|
||||
object $op = new Operations();
|
||||
$fn = $op->ops(6, 7, 'ADD');
|
||||
print($fn() + "\n");
|
||||
Console::Print($fn() + "\n");
|
||||
$fn = $op->ops(6, 2, 'SUB');
|
||||
print($fn() + "\n");
|
||||
Console::Print($fn() + "\n");
|
||||
$fn = $op->ops(6, 7, 'MUL');
|
||||
print($fn() + "\n");
|
||||
Console::Print($fn() + "\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user