Hi, I'm building a multi-nick AI bot with HexDroid scripts and ran into some behaviors during debugging. Would appreciate clarification on these:
MAP KEY DELETION
setat %map key $null does NOT remove the key — $keys() still lists it,
$has($keys(...), key) returns true, only $get() returns empty.
Is this expected? Is there ANY way to actually delete a key from a map,
short of rebuilding the entire map with $map()?
MAP PERFORMANCE
$get / setat O(1) or O(n) on map size?foreach %map over 1000+ entries safe within time budget?STRING PARSING HAZARDS We discovered:
; inside a string truncates the rest (becomes comment)\" becomes literal \ + " (2 chars), not escaped quote— and en-dash – work fine( ) work if balanced
What other characters are problematic inside string literals?
Is there a documented list of "safe" vs "unsafe" chars?%q VARIABLE
You mentioned %q = ", but in our test $len(%q) returns 0.
In what context is %q valid? Is it only usable inside function
arguments (like $split(str, %q)), not as field access?
TIME BUDGET EXCEEDED You confirmed it's CPU suspend causing wall-clock jump. Follow-up:
on RESUME)?MULTI-SESSION EVENT BEHAVIOR When user logs in with 2+ nicknames on same app:
on TEXT fire in EVERY session, or only the receiving one?NEWLINE
$chr(10) returns empty, \n literal = 2 chars. Any way to include
actual newline in a string sent to AI? We currently use " [next] " as
separator workaround.
TIMER BEST PRACTICE AT SCALE For a delay system (reply after 30-90s), which is lighter on battery:
Thanks, this will help me decide optimal design.
Raw Paste