Final note: In fact, it has been established (on this newsgroup as well as >> empirically by me and others) that if the indices are small integers, you
get sorting for free (in GAWK, which, as noted, is all we care about). So, >> you don't even really need to mess with PROCINFO[]...
Are you referring to the idea of just replacing the above for + if
structure with:
for (i in rank) {
}
and relying on the small integer indices being hashed in order?
Where is that documented? The manual reiterates that this is not
specified: "By default, the order in which a for (indx in array) loop
scans an array is not defined; it is generally based upon the internal >implementation of arrays inside awk."
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,030 |
Nodes: | 10 (0 / 10) |
Uptime: | 200:40:25 |
Calls: | 13,340 |
Calls today: | 3 |
Files: | 186,574 |
D/L today: |
3,438 files (1,066M bytes) |
Messages: | 3,357,051 |