selfhost/runtime: Stage 0-1 runner + MIR JSON loader (summary) with trace; compiler: scopebox/loopform prepass wiring (flags, child args); libs: add P1 standard boxes (console/string/array/map) as thin wrappers; runner: pass --box-pref via env; ops_calls dispatcher skeleton; docs: selfhost executor roadmap + scopebox/loopform notes; smokes: selfhost runner + identity prepasses; CURRENT_TASK: update plan and box lib schedule
This commit is contained in:
32
apps/lib/boxes/map_std.nyash
Normal file
32
apps/lib/boxes/map_std.nyash
Normal file
@ -0,0 +1,32 @@
|
||||
// MapStd — minimal standard map helpers (commonized API)
|
||||
|
||||
static box MapStd {
|
||||
size(m) {
|
||||
if m == null { return 0 }
|
||||
if m.size { return m.size() }
|
||||
return 0
|
||||
}
|
||||
has(m, key) {
|
||||
if m == null { return 0 }
|
||||
if m.has { return m.has(key) }
|
||||
// fallback: compare get() to null
|
||||
if m.get { return m.get(key) != null ? 1 : 0 }
|
||||
return 0
|
||||
}
|
||||
get(m, key) {
|
||||
if m == null { return null }
|
||||
if m.get { return m.get(key) }
|
||||
return null
|
||||
}
|
||||
set(m, key, val) {
|
||||
if m == null { return 0 }
|
||||
if m.set { m.set(key, val) return 0 }
|
||||
return 0
|
||||
}
|
||||
toString(m) {
|
||||
if m == null { return "{}" }
|
||||
if m.toString { return m.toString() }
|
||||
return "{}"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user