phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
27
apps/lib/boxes/console_std.hako
Normal file
27
apps/lib/boxes/console_std.hako
Normal file
@ -0,0 +1,27 @@
|
||||
// ConsoleStd — minimal standard console helpers (commonized API)
|
||||
|
||||
// Global helper to avoid name shadowing when invoking the language-level print.
|
||||
function __console_std_emit(value) {
|
||||
print(value)
|
||||
return 0
|
||||
}
|
||||
|
||||
static box ConsoleStd {
|
||||
// print/println/log: convert null to "" and return 0
|
||||
print(x) {
|
||||
if x == null { x = "" }
|
||||
__console_std_emit(x)
|
||||
return 0
|
||||
}
|
||||
println(x) {
|
||||
if x == null { x = "" }
|
||||
__console_std_emit(x)
|
||||
return 0
|
||||
}
|
||||
log(x) {
|
||||
if x == null { x = "" }
|
||||
__console_std_emit(x)
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user