Add TextWriter, IOException, per-VM module data and pre-load imports; Add console module with Console class

This commit is contained in:
2026-11-23 18:36:46 +01:00
parent 2243557bf5
commit 4d06edd045
55 changed files with 1679 additions and 675 deletions
+5 -1
View File
@@ -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"));
}
}