[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] [Manual] Adding an example for asort() call with a compar
From: |
Stéphane Goujet |
Subject: |
Re: [bug-gawk] [Manual] Adding an example for asort() call with a comparison function |
Date: |
Fri, 15 Jan 2016 14:31:02 +0100 (CET) |
User-agent: |
Alpine 2.00 (LNX 1167 2008-08-23) |
On Fri, 15 Jan 2016, Aharon Robbins wrote:
Hi. I have added an example of using a comparison function with asort()
to the manual. It's in the Git repo. Let me know if you want a diff.
It looks fine!
I also tested the example: it runs OK.
No need for a diff. Thank you!
Totally unrelated,:I do not know if it is your server's or my browser's
fault, but the display of
<http://git.savannah.gnu.org/cgit/gawk.git/tree/doc/gawk.info>
is cut, probably because the page is too long or it takes a too long time
to load, like this, around line 11000 (it varies) :
HTML page source code abruptly ends with:
===============================
8.1.1 Introduction to Arrays
----------------------------
Doing linear scans over an associative array is like trying to club
someone to death with a loaded Uzi.
-- _Larry Wall_
The 'awk' language provides one-dimensional arrays for storing groups
of related strings or numbers. Every 'awk' array must have a name.
Array names have the same syntax as variable names; any valid variable
name would also be a valid array name. But one name cannot be used in
both ways (as an array and as a variable) in the same 'awk' program.
Arrays in 'awk' superficially resemble arrays in other programming
languages, but there are fundamental differences. In 'awk', it isn't
necessary to specify the size of an array before starting to use it.
Additionally, any number or string, not just consecutive integers, may
be used as an array index.
In most other languages, arrays must be "declared" before use,
including a specification of how many elements or components they
contain. In such languages, the declaration causes a contiguous block
of memory to be allocated for that many elements. Usually, an index in
the array must be a nonnegative integer. For example, the index zero
specifies the first element in the array, which is actually stored at
the beginning of the block of memory. Index one specifies the second
element, which is stored in memory right after the first element, and so
on. It is impossible to add more elements to the array, because it has
room only for as many elements as given in the declaration. (Some
languages allow arbitrary starting and ending indices--e.g., '15 ..
27'--but the size of the array is still fixed when the array is
declared.)
A contiguous array of four elements might look like *note Figure 8.1:
figure-array-elements, conceptually, if the element values are eight,
'"foo"', '""', and 30.
</code></pre></td></tr></table>
</div> <!-- class=content -->
</div> <!-- id=cgit -->
</body>
</html>
===============================
On the display, line numbering goes on until 35645 but the content is
blank between around line 11000 and line 35645.
Goodbye,
Stéphane Goujet.