Add TextWriter, IOException, per-VM module data and pre-load imports; Add console module with Console class
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import 'console';
|
||||
class Program {
|
||||
|
||||
public void main(string[] $args) {
|
||||
callback $y = void() {
|
||||
callback $a = 'printf';
|
||||
callback $a = void(string $s) { Console::Print($s); };
|
||||
$a("I'm alive\n");
|
||||
var_dump($a);
|
||||
};
|
||||
@@ -10,6 +11,9 @@ class Program {
|
||||
var_dump($y);
|
||||
string $a = 'printf';
|
||||
var_dump($a);
|
||||
/* A string naming a builtin resolves as a callback value (C5). */
|
||||
callback $f = 'strtoupper';
|
||||
Console::PrintLine($f("builtin by name: " + "mixED"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user