fixed a critical bug in resizing an array - damn residual code

improved array/map field set/iteration functions
This commit is contained in:
2025-11-12 17:06:12 +09:00
parent d917f812d7
commit bdc4b0d9ea
9 changed files with 226 additions and 142 deletions

View File

@@ -960,6 +960,18 @@ BEGIN {
END { close("cat"); print "ENDED"; }
```
```awk
BEGIN {
cmd = "sort";
data = hawk::array("hello", "world", "two-way pipe", "testing");
for (i = 1; i <= length(data); i++) print data[i] |& cmd;
close(cmd, "to");
while ((cmd |& getline line) > 0) print line;
close(cmd);
}
```
## Garbage Collection
The primary value management is reference counting based but `map` and `array` values are garbage-collected additionally.