aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/ChangeLog6
-rw-r--r--doc/gawk.info437
-rw-r--r--doc/gawk.texi12
-rw-r--r--doc/gawktexi.in12
4 files changed, 237 insertions, 230 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 7bffb2ab..71bc1ec9 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,9 @@
+2016-01-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Array Sorting Functions): Clean up the code some,
+ per suggestion from Michal Jaegermann. Tighten up the prose
+ a bit too.
+
2016-01-14 Arnold D. Robbins <arnold@skeeve.com>
* ChangeLog: Remove spurious whitespace.
diff --git a/doc/gawk.info b/doc/gawk.info
index 1d50f327..2ca2dfa7 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -19706,8 +19706,8 @@ Note also that the locale's sorting order does _not_ come into play;
comparisons are based on character values only.(1)
The following example demonstrates the use of a comparison function
-with 'asort()'. The comparison function, 'case_fold_compare()', does a
-string comparison ignoring case (by mapping both values to lowercase).
+with 'asort()'. The comparison function, 'case_fold_compare()', maps
+both values to lowercase in order to compare them ignoring case.
# case_fold_compare --- compare as strings, ignoring case
@@ -19735,9 +19735,10 @@ string comparison ignoring case (by mapping both values to lowercase).
asort(data, result, "case_fold_compare")
- for (i = 1; i <= 52; i++) {
+ j = length(result)
+ for (i = 1; i <= j; i++) {
printf("%s", result[i])
- if (i % 26 == 0)
+ if (i % (j/2) == 0)
printf("\n")
else
printf(" ")
@@ -35426,219 +35427,219 @@ Node: Array Sorting789561
Node: Controlling Array Traversal790261
Ref: Controlling Array Traversal-Footnote-1798630
Node: Array Sorting Functions798748
-Ref: Array Sorting Functions-Footnote-1803817
-Node: Two-way I/O804013
-Ref: Two-way I/O-Footnote-1808964
-Ref: Two-way I/O-Footnote-2809151
-Node: TCP/IP Networking809233
-Node: Profiling812351
-Node: Advanced Features Summary820622
-Node: Internationalization822466
-Node: I18N and L10N823946
-Node: Explaining gettext824633
-Ref: Explaining gettext-Footnote-1829656
-Ref: Explaining gettext-Footnote-2829841
-Node: Programmer i18n830006
-Ref: Programmer i18n-Footnote-1834862
-Node: Translator i18n834911
-Node: String Extraction835705
-Ref: String Extraction-Footnote-1836838
-Node: Printf Ordering836924
-Ref: Printf Ordering-Footnote-1839710
-Node: I18N Portability839774
-Ref: I18N Portability-Footnote-1842230
-Node: I18N Example842293
-Ref: I18N Example-Footnote-1845099
-Node: Gawk I18N845172
-Node: I18N Summary845817
-Node: Debugger847158
-Node: Debugging848180
-Node: Debugging Concepts848621
-Node: Debugging Terms850430
-Node: Awk Debugging853005
-Node: Sample Debugging Session853911
-Node: Debugger Invocation854445
-Node: Finding The Bug855831
-Node: List of Debugger Commands862309
-Node: Breakpoint Control863642
-Node: Debugger Execution Control867336
-Node: Viewing And Changing Data870698
-Node: Execution Stack874072
-Node: Debugger Info875709
-Node: Miscellaneous Debugger Commands879780
-Node: Readline Support884868
-Node: Limitations885764
-Ref: Limitations-Footnote-1889995
-Node: Debugging Summary890046
-Node: Arbitrary Precision Arithmetic891325
-Node: Computer Arithmetic892741
-Ref: table-numeric-ranges896332
-Ref: Computer Arithmetic-Footnote-1897054
-Node: Math Definitions897111
-Ref: table-ieee-formats900425
-Ref: Math Definitions-Footnote-1901028
-Node: MPFR features901133
-Node: FP Math Caution902806
-Ref: FP Math Caution-Footnote-1903878
-Node: Inexactness of computations904247
-Node: Inexact representation905207
-Node: Comparing FP Values906567
-Node: Errors accumulate907649
-Node: Getting Accuracy909082
-Node: Try To Round911792
-Node: Setting precision912691
-Ref: table-predefined-precision-strings913388
-Node: Setting the rounding mode915218
-Ref: table-gawk-rounding-modes915592
-Ref: Setting the rounding mode-Footnote-1919000
-Node: Arbitrary Precision Integers919179
-Ref: Arbitrary Precision Integers-Footnote-1924096
-Node: POSIX Floating Point Problems924245
-Ref: POSIX Floating Point Problems-Footnote-1928127
-Node: Floating point summary928165
-Node: Dynamic Extensions930355
-Node: Extension Intro931908
-Node: Plugin License933174
-Node: Extension Mechanism Outline933971
-Ref: figure-load-extension934410
-Ref: figure-register-new-function935975
-Ref: figure-call-new-function937067
-Node: Extension API Description939130
-Node: Extension API Functions Introduction940662
-Node: General Data Types945521
-Ref: General Data Types-Footnote-1951476
-Node: Memory Allocation Functions951775
-Ref: Memory Allocation Functions-Footnote-1954620
-Node: Constructor Functions954719
-Node: Registration Functions956464
-Node: Extension Functions957149
-Node: Exit Callback Functions959448
-Node: Extension Version String960698
-Node: Input Parsers961361
-Node: Output Wrappers971246
-Node: Two-way processors975758
-Node: Printing Messages978022
-Ref: Printing Messages-Footnote-1979096
-Node: Updating ERRNO979249
-Node: Requesting Values979988
-Ref: table-value-types-returned980725
-Node: Accessing Parameters981608
-Node: Symbol Table Access982844
-Node: Symbol table by name983356
-Node: Symbol table by cookie985377
-Ref: Symbol table by cookie-Footnote-1989526
-Node: Cached values989590
-Ref: Cached values-Footnote-1993091
-Node: Array Manipulation993182
-Ref: Array Manipulation-Footnote-1994273
-Node: Array Data Types994310
-Ref: Array Data Types-Footnote-1996968
-Node: Array Functions997060
-Node: Flattening Arrays1000919
-Node: Creating Arrays1007827
-Node: Redirection API1012599
-Node: Extension API Variables1015430
-Node: Extension Versioning1016063
-Node: Extension API Informational Variables1017954
-Node: Extension API Boilerplate1019018
-Node: Finding Extensions1022832
-Node: Extension Example1023392
-Node: Internal File Description1024190
-Node: Internal File Ops1028270
-Ref: Internal File Ops-Footnote-11040032
-Node: Using Internal File Ops1040172
-Ref: Using Internal File Ops-Footnote-11042555
-Node: Extension Samples1042830
-Node: Extension Sample File Functions1044359
-Node: Extension Sample Fnmatch1052008
-Node: Extension Sample Fork1053495
-Node: Extension Sample Inplace1054713
-Node: Extension Sample Ord1057923
-Node: Extension Sample Readdir1058759
-Ref: table-readdir-file-types1059648
-Node: Extension Sample Revout1060453
-Node: Extension Sample Rev2way1061042
-Node: Extension Sample Read write array1061782
-Node: Extension Sample Readfile1063724
-Node: Extension Sample Time1064819
-Node: Extension Sample API Tests1066167
-Node: gawkextlib1066659
-Node: Extension summary1069106
-Node: Extension Exercises1072798
-Node: Language History1074295
-Node: V7/SVR3.11075951
-Node: SVR41078103
-Node: POSIX1079537
-Node: BTL1080917
-Node: POSIX/GNU1081647
-Node: Feature History1087486
-Node: Common Extensions1101856
-Node: Ranges and Locales1103139
-Ref: Ranges and Locales-Footnote-11107755
-Ref: Ranges and Locales-Footnote-21107782
-Ref: Ranges and Locales-Footnote-31108017
-Node: Contributors1108238
-Node: History summary1113807
-Node: Installation1115187
-Node: Gawk Distribution1116132
-Node: Getting1116616
-Node: Extracting1117577
-Node: Distribution contents1119215
-Node: Unix Installation1125311
-Node: Quick Installation1125993
-Node: Shell Startup Files1128407
-Node: Additional Configuration Options1129485
-Node: Configuration Philosophy1131290
-Node: Non-Unix Installation1133660
-Node: PC Installation1134118
-Node: PC Binary Installation1135438
-Node: PC Compiling1137290
-Ref: PC Compiling-Footnote-11140314
-Node: PC Testing1140423
-Node: PC Using1141603
-Node: Cygwin1145717
-Node: MSYS1146487
-Node: VMS Installation1146988
-Node: VMS Compilation1147779
-Ref: VMS Compilation-Footnote-11149009
-Node: VMS Dynamic Extensions1149067
-Node: VMS Installation Details1150752
-Node: VMS Running1153005
-Node: VMS GNV1155846
-Node: VMS Old Gawk1156581
-Node: Bugs1157052
-Node: Other Versions1161249
-Node: Installation summary1167835
-Node: Notes1168893
-Node: Compatibility Mode1169758
-Node: Additions1170540
-Node: Accessing The Source1171465
-Node: Adding Code1172901
-Node: New Ports1179120
-Node: Derived Files1183608
-Ref: Derived Files-Footnote-11189093
-Ref: Derived Files-Footnote-21189128
-Ref: Derived Files-Footnote-31189726
-Node: Future Extensions1189840
-Node: Implementation Limitations1190498
-Node: Extension Design1191681
-Node: Old Extension Problems1192835
-Ref: Old Extension Problems-Footnote-11194353
-Node: Extension New Mechanism Goals1194410
-Ref: Extension New Mechanism Goals-Footnote-11197774
-Node: Extension Other Design Decisions1197963
-Node: Extension Future Growth1200076
-Node: Old Extension Mechanism1200912
-Node: Notes summary1202675
-Node: Basic Concepts1203857
-Node: Basic High Level1204538
-Ref: figure-general-flow1204820
-Ref: figure-process-flow1205505
-Ref: Basic High Level-Footnote-11208806
-Node: Basic Data Typing1208991
-Node: Glossary1212319
-Node: Copying1244265
-Node: GNU Free Documentation License1281804
-Node: Index1306922
+Ref: Array Sorting Functions-Footnote-1803839
+Node: Two-way I/O804035
+Ref: Two-way I/O-Footnote-1808986
+Ref: Two-way I/O-Footnote-2809173
+Node: TCP/IP Networking809255
+Node: Profiling812373
+Node: Advanced Features Summary820644
+Node: Internationalization822488
+Node: I18N and L10N823968
+Node: Explaining gettext824655
+Ref: Explaining gettext-Footnote-1829678
+Ref: Explaining gettext-Footnote-2829863
+Node: Programmer i18n830028
+Ref: Programmer i18n-Footnote-1834884
+Node: Translator i18n834933
+Node: String Extraction835727
+Ref: String Extraction-Footnote-1836860
+Node: Printf Ordering836946
+Ref: Printf Ordering-Footnote-1839732
+Node: I18N Portability839796
+Ref: I18N Portability-Footnote-1842252
+Node: I18N Example842315
+Ref: I18N Example-Footnote-1845121
+Node: Gawk I18N845194
+Node: I18N Summary845839
+Node: Debugger847180
+Node: Debugging848202
+Node: Debugging Concepts848643
+Node: Debugging Terms850452
+Node: Awk Debugging853027
+Node: Sample Debugging Session853933
+Node: Debugger Invocation854467
+Node: Finding The Bug855853
+Node: List of Debugger Commands862331
+Node: Breakpoint Control863664
+Node: Debugger Execution Control867358
+Node: Viewing And Changing Data870720
+Node: Execution Stack874094
+Node: Debugger Info875731
+Node: Miscellaneous Debugger Commands879802
+Node: Readline Support884890
+Node: Limitations885786
+Ref: Limitations-Footnote-1890017
+Node: Debugging Summary890068
+Node: Arbitrary Precision Arithmetic891347
+Node: Computer Arithmetic892763
+Ref: table-numeric-ranges896354
+Ref: Computer Arithmetic-Footnote-1897076
+Node: Math Definitions897133
+Ref: table-ieee-formats900447
+Ref: Math Definitions-Footnote-1901050
+Node: MPFR features901155
+Node: FP Math Caution902828
+Ref: FP Math Caution-Footnote-1903900
+Node: Inexactness of computations904269
+Node: Inexact representation905229
+Node: Comparing FP Values906589
+Node: Errors accumulate907671
+Node: Getting Accuracy909104
+Node: Try To Round911814
+Node: Setting precision912713
+Ref: table-predefined-precision-strings913410
+Node: Setting the rounding mode915240
+Ref: table-gawk-rounding-modes915614
+Ref: Setting the rounding mode-Footnote-1919022
+Node: Arbitrary Precision Integers919201
+Ref: Arbitrary Precision Integers-Footnote-1924118
+Node: POSIX Floating Point Problems924267
+Ref: POSIX Floating Point Problems-Footnote-1928149
+Node: Floating point summary928187
+Node: Dynamic Extensions930377
+Node: Extension Intro931930
+Node: Plugin License933196
+Node: Extension Mechanism Outline933993
+Ref: figure-load-extension934432
+Ref: figure-register-new-function935997
+Ref: figure-call-new-function937089
+Node: Extension API Description939152
+Node: Extension API Functions Introduction940684
+Node: General Data Types945543
+Ref: General Data Types-Footnote-1951498
+Node: Memory Allocation Functions951797
+Ref: Memory Allocation Functions-Footnote-1954642
+Node: Constructor Functions954741
+Node: Registration Functions956486
+Node: Extension Functions957171
+Node: Exit Callback Functions959470
+Node: Extension Version String960720
+Node: Input Parsers961383
+Node: Output Wrappers971268
+Node: Two-way processors975780
+Node: Printing Messages978044
+Ref: Printing Messages-Footnote-1979118
+Node: Updating ERRNO979271
+Node: Requesting Values980010
+Ref: table-value-types-returned980747
+Node: Accessing Parameters981630
+Node: Symbol Table Access982866
+Node: Symbol table by name983378
+Node: Symbol table by cookie985399
+Ref: Symbol table by cookie-Footnote-1989548
+Node: Cached values989612
+Ref: Cached values-Footnote-1993113
+Node: Array Manipulation993204
+Ref: Array Manipulation-Footnote-1994295
+Node: Array Data Types994332
+Ref: Array Data Types-Footnote-1996990
+Node: Array Functions997082
+Node: Flattening Arrays1000941
+Node: Creating Arrays1007849
+Node: Redirection API1012621
+Node: Extension API Variables1015452
+Node: Extension Versioning1016085
+Node: Extension API Informational Variables1017976
+Node: Extension API Boilerplate1019040
+Node: Finding Extensions1022854
+Node: Extension Example1023414
+Node: Internal File Description1024212
+Node: Internal File Ops1028292
+Ref: Internal File Ops-Footnote-11040054
+Node: Using Internal File Ops1040194
+Ref: Using Internal File Ops-Footnote-11042577
+Node: Extension Samples1042852
+Node: Extension Sample File Functions1044381
+Node: Extension Sample Fnmatch1052030
+Node: Extension Sample Fork1053517
+Node: Extension Sample Inplace1054735
+Node: Extension Sample Ord1057945
+Node: Extension Sample Readdir1058781
+Ref: table-readdir-file-types1059670
+Node: Extension Sample Revout1060475
+Node: Extension Sample Rev2way1061064
+Node: Extension Sample Read write array1061804
+Node: Extension Sample Readfile1063746
+Node: Extension Sample Time1064841
+Node: Extension Sample API Tests1066189
+Node: gawkextlib1066681
+Node: Extension summary1069128
+Node: Extension Exercises1072820
+Node: Language History1074317
+Node: V7/SVR3.11075973
+Node: SVR41078125
+Node: POSIX1079559
+Node: BTL1080939
+Node: POSIX/GNU1081669
+Node: Feature History1087508
+Node: Common Extensions1101878
+Node: Ranges and Locales1103161
+Ref: Ranges and Locales-Footnote-11107777
+Ref: Ranges and Locales-Footnote-21107804
+Ref: Ranges and Locales-Footnote-31108039
+Node: Contributors1108260
+Node: History summary1113829
+Node: Installation1115209
+Node: Gawk Distribution1116154
+Node: Getting1116638
+Node: Extracting1117599
+Node: Distribution contents1119237
+Node: Unix Installation1125333
+Node: Quick Installation1126015
+Node: Shell Startup Files1128429
+Node: Additional Configuration Options1129507
+Node: Configuration Philosophy1131312
+Node: Non-Unix Installation1133682
+Node: PC Installation1134140
+Node: PC Binary Installation1135460
+Node: PC Compiling1137312
+Ref: PC Compiling-Footnote-11140336
+Node: PC Testing1140445
+Node: PC Using1141625
+Node: Cygwin1145739
+Node: MSYS1146509
+Node: VMS Installation1147010
+Node: VMS Compilation1147801
+Ref: VMS Compilation-Footnote-11149031
+Node: VMS Dynamic Extensions1149089
+Node: VMS Installation Details1150774
+Node: VMS Running1153027
+Node: VMS GNV1155868
+Node: VMS Old Gawk1156603
+Node: Bugs1157074
+Node: Other Versions1161271
+Node: Installation summary1167857
+Node: Notes1168915
+Node: Compatibility Mode1169780
+Node: Additions1170562
+Node: Accessing The Source1171487
+Node: Adding Code1172923
+Node: New Ports1179142
+Node: Derived Files1183630
+Ref: Derived Files-Footnote-11189115
+Ref: Derived Files-Footnote-21189150
+Ref: Derived Files-Footnote-31189748
+Node: Future Extensions1189862
+Node: Implementation Limitations1190520
+Node: Extension Design1191703
+Node: Old Extension Problems1192857
+Ref: Old Extension Problems-Footnote-11194375
+Node: Extension New Mechanism Goals1194432
+Ref: Extension New Mechanism Goals-Footnote-11197796
+Node: Extension Other Design Decisions1197985
+Node: Extension Future Growth1200098
+Node: Old Extension Mechanism1200934
+Node: Notes summary1202697
+Node: Basic Concepts1203879
+Node: Basic High Level1204560
+Ref: figure-general-flow1204842
+Ref: figure-process-flow1205527
+Ref: Basic High Level-Footnote-11208828
+Node: Basic Data Typing1209013
+Node: Glossary1212341
+Node: Copying1244287
+Node: GNU Free Documentation License1281826
+Node: Index1306944

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 3a53597b..715ac862 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -27569,10 +27569,9 @@ is true because locale-based comparison occurs only when in
POSIX-compatibility mode, and because @code{asort()} and @code{asorti()} are
@command{gawk} extensions, they are not available in that case.}
-The following example demonstrates the use of a comparison function
-with @code{asort()}. The comparison function,
-@code{case_fold_compare()}, does a string comparison ignoring case
-(by mapping both values to lowercase).
+The following example demonstrates the use of a comparison function with
+@code{asort()}. The comparison function, @code{case_fold_compare()}, maps
+both values to lowercase in order to compare them ignoring case.
@example
# case_fold_compare --- compare as strings, ignoring case
@@ -27603,9 +27602,10 @@ BEGIN @{
asort(data, result, "case_fold_compare")
- for (i = 1; i <= 52; i++) @{
+ j = length(result)
+ for (i = 1; i <= j; i++) @{
printf("%s", result[i])
- if (i % 26 == 0)
+ if (i % (j/2) == 0)
printf("\n")
else
printf(" ")
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 699079f3..dde24353 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -26660,10 +26660,9 @@ is true because locale-based comparison occurs only when in
POSIX-compatibility mode, and because @code{asort()} and @code{asorti()} are
@command{gawk} extensions, they are not available in that case.}
-The following example demonstrates the use of a comparison function
-with @code{asort()}. The comparison function,
-@code{case_fold_compare()}, does a string comparison ignoring case
-(by mapping both values to lowercase).
+The following example demonstrates the use of a comparison function with
+@code{asort()}. The comparison function, @code{case_fold_compare()}, maps
+both values to lowercase in order to compare them ignoring case.
@example
# case_fold_compare --- compare as strings, ignoring case
@@ -26694,9 +26693,10 @@ BEGIN @{
asort(data, result, "case_fold_compare")
- for (i = 1; i <= 52; i++) @{
+ j = length(result)
+ for (i = 1; i <= j; i++) @{
printf("%s", result[i])
- if (i % 26 == 0)
+ if (i % (j/2) == 0)
printf("\n")
else
printf(" ")