ludic.ui: props kept an instance, a call's arguments a depth, a loop's index shared, an absent attribute's text without a Value; runtime Value.clear - benchmark 36 -> 20 KB a frame

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-27 23:46:18 +03:00
parent 46888b6716
commit 51a5e06f5c
10 changed files with 43 additions and 5 deletions

View file

@ -78,7 +78,13 @@ export function ui_attr(n: UiNode, key: string) -> Val {
}
return Value.null()
}
export function ui_attr_text(n: UiNode, key: string) -> string { return vl_text(ui_attr(n, key)) }
export function ui_attr_text(n: UiNode, key: string) -> string {
if n.akeys == null { return "" }
for i in 0 .. len(n.akeys) {
if n.akeys[i] == key { return vl_text(n.vals[i]) }
}
return ""
}
# a boolean attribute: present with no value is true, as HTML's are (<button autofocus>)
export function ui_attr_on(n: UiNode, key: string) -> bool {
if n.akeys == null { return false }