gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, feature/fix-indirect-call, updated. gawk


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, feature/fix-indirect-call, updated. gawk-4.1.0-625-g0ed7e09
Date: Tue, 31 Mar 2015 19:22:11 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, feature/fix-indirect-call has been updated
       via  0ed7e09458bdb6185586a8a0bec747b2f800ca16 (commit)
       via  67d5cc4c4034f16a2390e30d8e988713e5aedb68 (commit)
       via  a47af3141cf4a6b43e20db872e2b45ff9abb071f (commit)
      from  2ee1a928483f4fe4f594aebc5c1f8da1253c28b9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=0ed7e09458bdb6185586a8a0bec747b2f800ca16

commit 0ed7e09458bdb6185586a8a0bec747b2f800ca16
Author: Arnold D. Robbins <address@hidden>
Date:   Tue Mar 31 22:21:30 2015 +0300

    Update doc on calling built-ins indirectly.

diff --git a/doc/ChangeLog b/doc/ChangeLog
index 6dbe79d..2f5dabb 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-31         Arnold D. Robbins     <address@hidden>
+
+       * gawktexi.in: Update discussion of calling built-in functions
+       indirectly.
+
 2015-03-24         Arnold D. Robbins     <address@hidden>
 
        * gawktexi.in: Minor fixes from Antonio Colombo and new exercise
diff --git a/doc/gawk.info b/doc/gawk.info
index 6cb2abd..9b6a46f 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -14294,9 +14294,17 @@ function call.
 
    Starting with version 4.1.2 of `gawk', indirect function calls may
 also be used with built-in functions and with extension functions
-(*note Dynamic Extensions::).  The only thing you cannot do is pass a
-regular expression constant to a built-in function through an indirect
-function call.(1)
+(*note Dynamic Extensions::). There are some limitations when calling
+built-in functions indirectly, as follows.
+
+   * You cannot pass a regular expression constant to a built-in
+     function through an indirect function call.(1) This applies to the
+     `sub()', `gsub()', `gensub()', `match()', `split()' and
+     `patsplit()' functions.
+
+   * If calling `sub()' or `gsub()', you may only pass two arguments,
+     since those functions are unusual in that they update their third
+     argument.  This means that `$0' will be updated.
 
    `gawk' does its best to make indirect function calls efficient.  For
 example, in the following case:
@@ -34777,292 +34785,292 @@ Node: Pass By Value/Reference579678
 Node: Return Statement583175
 Node: Dynamic Typing586154
 Node: Indirect Calls587083
-Ref: Indirect Calls-Footnote-1596948
-Node: Functions Summary597076
-Node: Library Functions599778
-Ref: Library Functions-Footnote-1603386
-Ref: Library Functions-Footnote-2603529
-Node: Library Names603700
-Ref: Library Names-Footnote-1607158
-Ref: Library Names-Footnote-2607381
-Node: General Functions607467
-Node: Strtonum Function608570
-Node: Assert Function611592
-Node: Round Function614916
-Node: Cliff Random Function616457
-Node: Ordinal Functions617473
-Ref: Ordinal Functions-Footnote-1620536
-Ref: Ordinal Functions-Footnote-2620788
-Node: Join Function620999
-Ref: Join Function-Footnote-1622769
-Node: Getlocaltime Function622969
-Node: Readfile Function626713
-Node: Shell Quoting628685
-Node: Data File Management630086
-Node: Filetrans Function630718
-Node: Rewind Function634814
-Node: File Checking636200
-Ref: File Checking-Footnote-1637533
-Node: Empty Files637734
-Node: Ignoring Assigns639713
-Node: Getopt Function641263
-Ref: Getopt Function-Footnote-1652727
-Node: Passwd Functions652927
-Ref: Passwd Functions-Footnote-1661767
-Node: Group Functions661855
-Ref: Group Functions-Footnote-1669752
-Node: Walking Arrays669957
-Node: Library Functions Summary672963
-Node: Library Exercises674365
-Node: Sample Programs675645
-Node: Running Examples676415
-Node: Clones677143
-Node: Cut Program678367
-Node: Egrep Program688087
-Ref: Egrep Program-Footnote-1695590
-Node: Id Program695700
-Node: Split Program699376
-Ref: Split Program-Footnote-1702830
-Node: Tee Program702958
-Node: Uniq Program705747
-Node: Wc Program713166
-Ref: Wc Program-Footnote-1717416
-Node: Miscellaneous Programs717510
-Node: Dupword Program718723
-Node: Alarm Program720754
-Node: Translate Program725559
-Ref: Translate Program-Footnote-1730122
-Node: Labels Program730392
-Ref: Labels Program-Footnote-1733743
-Node: Word Sorting733827
-Node: History Sorting737897
-Node: Extract Program739732
-Node: Simple Sed747256
-Node: Igawk Program750326
-Ref: Igawk Program-Footnote-1764652
-Ref: Igawk Program-Footnote-2764853
-Ref: Igawk Program-Footnote-3764975
-Node: Anagram Program765090
-Node: Signature Program768151
-Node: Programs Summary769398
-Node: Programs Exercises770619
-Ref: Programs Exercises-Footnote-1774750
-Node: Advanced Features774841
-Node: Nondecimal Data776823
-Node: Array Sorting778413
-Node: Controlling Array Traversal779113
-Ref: Controlling Array Traversal-Footnote-1787479
-Node: Array Sorting Functions787597
-Ref: Array Sorting Functions-Footnote-1791483
-Node: Two-way I/O791679
-Ref: Two-way I/O-Footnote-1796624
-Ref: Two-way I/O-Footnote-2796810
-Node: TCP/IP Networking796892
-Node: Profiling799764
-Node: Advanced Features Summary807305
-Node: Internationalization809238
-Node: I18N and L10N810718
-Node: Explaining gettext811404
-Ref: Explaining gettext-Footnote-1816429
-Ref: Explaining gettext-Footnote-2816613
-Node: Programmer i18n816778
-Ref: Programmer i18n-Footnote-1821654
-Node: Translator i18n821703
-Node: String Extraction822497
-Ref: String Extraction-Footnote-1823628
-Node: Printf Ordering823714
-Ref: Printf Ordering-Footnote-1826500
-Node: I18N Portability826564
-Ref: I18N Portability-Footnote-1829020
-Node: I18N Example829083
-Ref: I18N Example-Footnote-1831886
-Node: Gawk I18N831958
-Node: I18N Summary832602
-Node: Debugger833942
-Node: Debugging834964
-Node: Debugging Concepts835405
-Node: Debugging Terms837215
-Node: Awk Debugging839787
-Node: Sample Debugging Session840693
-Node: Debugger Invocation841227
-Node: Finding The Bug842612
-Node: List of Debugger Commands849091
-Node: Breakpoint Control850423
-Node: Debugger Execution Control854100
-Node: Viewing And Changing Data857459
-Node: Execution Stack860835
-Node: Debugger Info862470
-Node: Miscellaneous Debugger Commands866515
-Node: Readline Support871516
-Node: Limitations872410
-Node: Debugging Summary874525
-Node: Arbitrary Precision Arithmetic875699
-Node: Computer Arithmetic877115
-Ref: table-numeric-ranges880692
-Ref: Computer Arithmetic-Footnote-1881216
-Node: Math Definitions881273
-Ref: table-ieee-formats884568
-Ref: Math Definitions-Footnote-1885172
-Node: MPFR features885277
-Node: FP Math Caution886948
-Ref: FP Math Caution-Footnote-1887998
-Node: Inexactness of computations888367
-Node: Inexact representation889326
-Node: Comparing FP Values890684
-Node: Errors accumulate891766
-Node: Getting Accuracy893198
-Node: Try To Round895902
-Node: Setting precision896801
-Ref: table-predefined-precision-strings897485
-Node: Setting the rounding mode899314
-Ref: table-gawk-rounding-modes899678
-Ref: Setting the rounding mode-Footnote-1903130
-Node: Arbitrary Precision Integers903309
-Ref: Arbitrary Precision Integers-Footnote-1906293
-Node: POSIX Floating Point Problems906442
-Ref: POSIX Floating Point Problems-Footnote-1910321
-Node: Floating point summary910359
-Node: Dynamic Extensions912546
-Node: Extension Intro914098
-Node: Plugin License915363
-Node: Extension Mechanism Outline916160
-Ref: figure-load-extension916588
-Ref: figure-register-new-function918068
-Ref: figure-call-new-function919072
-Node: Extension API Description921059
-Node: Extension API Functions Introduction922509
-Node: General Data Types927330
-Ref: General Data Types-Footnote-1933230
-Node: Memory Allocation Functions933529
-Ref: Memory Allocation Functions-Footnote-1936368
-Node: Constructor Functions936467
-Node: Registration Functions938206
-Node: Extension Functions938891
-Node: Exit Callback Functions941188
-Node: Extension Version String942436
-Node: Input Parsers943099
-Node: Output Wrappers952974
-Node: Two-way processors957487
-Node: Printing Messages959750
-Ref: Printing Messages-Footnote-1960826
-Node: Updating `ERRNO'960978
-Node: Requesting Values961718
-Ref: table-value-types-returned962445
-Node: Accessing Parameters963402
-Node: Symbol Table Access964636
-Node: Symbol table by name965150
-Node: Symbol table by cookie967170
-Ref: Symbol table by cookie-Footnote-1971315
-Node: Cached values971378
-Ref: Cached values-Footnote-1974874
-Node: Array Manipulation974965
-Ref: Array Manipulation-Footnote-1976063
-Node: Array Data Types976100
-Ref: Array Data Types-Footnote-1978755
-Node: Array Functions978847
-Node: Flattening Arrays982706
-Node: Creating Arrays989608
-Node: Extension API Variables994379
-Node: Extension Versioning995015
-Node: Extension API Informational Variables996906
-Node: Extension API Boilerplate997971
-Node: Finding Extensions1001780
-Node: Extension Example1002340
-Node: Internal File Description1003112
-Node: Internal File Ops1007179
-Ref: Internal File Ops-Footnote-11018930
-Node: Using Internal File Ops1019070
-Ref: Using Internal File Ops-Footnote-11021453
-Node: Extension Samples1021726
-Node: Extension Sample File Functions1023254
-Node: Extension Sample Fnmatch1030935
-Node: Extension Sample Fork1032423
-Node: Extension Sample Inplace1033638
-Node: Extension Sample Ord1035724
-Node: Extension Sample Readdir1036560
-Ref: table-readdir-file-types1037437
-Node: Extension Sample Revout1038248
-Node: Extension Sample Rev2way1038837
-Node: Extension Sample Read write array1039577
-Node: Extension Sample Readfile1041517
-Node: Extension Sample Time1042612
-Node: Extension Sample API Tests1043960
-Node: gawkextlib1044451
-Node: Extension summary1047129
-Node: Extension Exercises1050818
-Node: Language History1052314
-Node: V7/SVR3.11053970
-Node: SVR41056123
-Node: POSIX1057557
-Node: BTL1058938
-Node: POSIX/GNU1059669
-Node: Feature History1065190
-Node: Common Extensions1078288
-Node: Ranges and Locales1079660
-Ref: Ranges and Locales-Footnote-11084279
-Ref: Ranges and Locales-Footnote-21084306
-Ref: Ranges and Locales-Footnote-31084541
-Node: Contributors1084762
-Node: History summary1090302
-Node: Installation1091681
-Node: Gawk Distribution1092627
-Node: Getting1093111
-Node: Extracting1093934
-Node: Distribution contents1095571
-Node: Unix Installation1101325
-Node: Quick Installation1101942
-Node: Additional Configuration Options1104366
-Node: Configuration Philosophy1106169
-Node: Non-Unix Installation1108538
-Node: PC Installation1108996
-Node: PC Binary Installation1110316
-Node: PC Compiling1112164
-Ref: PC Compiling-Footnote-11115185
-Node: PC Testing1115294
-Node: PC Using1116470
-Node: Cygwin1120585
-Node: MSYS1121355
-Node: VMS Installation1121856
-Node: VMS Compilation1122648
-Ref: VMS Compilation-Footnote-11123877
-Node: VMS Dynamic Extensions1123935
-Node: VMS Installation Details1125619
-Node: VMS Running1127870
-Node: VMS GNV1130710
-Node: VMS Old Gawk1131445
-Node: Bugs1131915
-Node: Other Versions1135804
-Node: Installation summary1142238
-Node: Notes1143297
-Node: Compatibility Mode1144162
-Node: Additions1144944
-Node: Accessing The Source1145869
-Node: Adding Code1147304
-Node: New Ports1153461
-Node: Derived Files1157943
-Ref: Derived Files-Footnote-11163418
-Ref: Derived Files-Footnote-21163452
-Ref: Derived Files-Footnote-31164048
-Node: Future Extensions1164162
-Node: Implementation Limitations1164768
-Node: Extension Design1166016
-Node: Old Extension Problems1167170
-Ref: Old Extension Problems-Footnote-11168687
-Node: Extension New Mechanism Goals1168744
-Ref: Extension New Mechanism Goals-Footnote-11172104
-Node: Extension Other Design Decisions1172293
-Node: Extension Future Growth1174401
-Node: Old Extension Mechanism1175237
-Node: Notes summary1176999
-Node: Basic Concepts1178185
-Node: Basic High Level1178866
-Ref: figure-general-flow1179138
-Ref: figure-process-flow1179737
-Ref: Basic High Level-Footnote-11182966
-Node: Basic Data Typing1183151
-Node: Glossary1186479
-Node: Copying1218408
-Node: GNU Free Documentation License1255964
-Node: Index1281100
+Ref: Indirect Calls-Footnote-1597326
+Node: Functions Summary597454
+Node: Library Functions600156
+Ref: Library Functions-Footnote-1603764
+Ref: Library Functions-Footnote-2603907
+Node: Library Names604078
+Ref: Library Names-Footnote-1607536
+Ref: Library Names-Footnote-2607759
+Node: General Functions607845
+Node: Strtonum Function608948
+Node: Assert Function611970
+Node: Round Function615294
+Node: Cliff Random Function616835
+Node: Ordinal Functions617851
+Ref: Ordinal Functions-Footnote-1620914
+Ref: Ordinal Functions-Footnote-2621166
+Node: Join Function621377
+Ref: Join Function-Footnote-1623147
+Node: Getlocaltime Function623347
+Node: Readfile Function627091
+Node: Shell Quoting629063
+Node: Data File Management630464
+Node: Filetrans Function631096
+Node: Rewind Function635192
+Node: File Checking636578
+Ref: File Checking-Footnote-1637911
+Node: Empty Files638112
+Node: Ignoring Assigns640091
+Node: Getopt Function641641
+Ref: Getopt Function-Footnote-1653105
+Node: Passwd Functions653305
+Ref: Passwd Functions-Footnote-1662145
+Node: Group Functions662233
+Ref: Group Functions-Footnote-1670130
+Node: Walking Arrays670335
+Node: Library Functions Summary673341
+Node: Library Exercises674743
+Node: Sample Programs676023
+Node: Running Examples676793
+Node: Clones677521
+Node: Cut Program678745
+Node: Egrep Program688465
+Ref: Egrep Program-Footnote-1695968
+Node: Id Program696078
+Node: Split Program699754
+Ref: Split Program-Footnote-1703208
+Node: Tee Program703336
+Node: Uniq Program706125
+Node: Wc Program713544
+Ref: Wc Program-Footnote-1717794
+Node: Miscellaneous Programs717888
+Node: Dupword Program719101
+Node: Alarm Program721132
+Node: Translate Program725937
+Ref: Translate Program-Footnote-1730500
+Node: Labels Program730770
+Ref: Labels Program-Footnote-1734121
+Node: Word Sorting734205
+Node: History Sorting738275
+Node: Extract Program740110
+Node: Simple Sed747634
+Node: Igawk Program750704
+Ref: Igawk Program-Footnote-1765030
+Ref: Igawk Program-Footnote-2765231
+Ref: Igawk Program-Footnote-3765353
+Node: Anagram Program765468
+Node: Signature Program768529
+Node: Programs Summary769776
+Node: Programs Exercises770997
+Ref: Programs Exercises-Footnote-1775128
+Node: Advanced Features775219
+Node: Nondecimal Data777201
+Node: Array Sorting778791
+Node: Controlling Array Traversal779491
+Ref: Controlling Array Traversal-Footnote-1787857
+Node: Array Sorting Functions787975
+Ref: Array Sorting Functions-Footnote-1791861
+Node: Two-way I/O792057
+Ref: Two-way I/O-Footnote-1797002
+Ref: Two-way I/O-Footnote-2797188
+Node: TCP/IP Networking797270
+Node: Profiling800142
+Node: Advanced Features Summary807683
+Node: Internationalization809616
+Node: I18N and L10N811096
+Node: Explaining gettext811782
+Ref: Explaining gettext-Footnote-1816807
+Ref: Explaining gettext-Footnote-2816991
+Node: Programmer i18n817156
+Ref: Programmer i18n-Footnote-1822032
+Node: Translator i18n822081
+Node: String Extraction822875
+Ref: String Extraction-Footnote-1824006
+Node: Printf Ordering824092
+Ref: Printf Ordering-Footnote-1826878
+Node: I18N Portability826942
+Ref: I18N Portability-Footnote-1829398
+Node: I18N Example829461
+Ref: I18N Example-Footnote-1832264
+Node: Gawk I18N832336
+Node: I18N Summary832980
+Node: Debugger834320
+Node: Debugging835342
+Node: Debugging Concepts835783
+Node: Debugging Terms837593
+Node: Awk Debugging840165
+Node: Sample Debugging Session841071
+Node: Debugger Invocation841605
+Node: Finding The Bug842990
+Node: List of Debugger Commands849469
+Node: Breakpoint Control850801
+Node: Debugger Execution Control854478
+Node: Viewing And Changing Data857837
+Node: Execution Stack861213
+Node: Debugger Info862848
+Node: Miscellaneous Debugger Commands866893
+Node: Readline Support871894
+Node: Limitations872788
+Node: Debugging Summary874903
+Node: Arbitrary Precision Arithmetic876077
+Node: Computer Arithmetic877493
+Ref: table-numeric-ranges881070
+Ref: Computer Arithmetic-Footnote-1881594
+Node: Math Definitions881651
+Ref: table-ieee-formats884946
+Ref: Math Definitions-Footnote-1885550
+Node: MPFR features885655
+Node: FP Math Caution887326
+Ref: FP Math Caution-Footnote-1888376
+Node: Inexactness of computations888745
+Node: Inexact representation889704
+Node: Comparing FP Values891062
+Node: Errors accumulate892144
+Node: Getting Accuracy893576
+Node: Try To Round896280
+Node: Setting precision897179
+Ref: table-predefined-precision-strings897863
+Node: Setting the rounding mode899692
+Ref: table-gawk-rounding-modes900056
+Ref: Setting the rounding mode-Footnote-1903508
+Node: Arbitrary Precision Integers903687
+Ref: Arbitrary Precision Integers-Footnote-1906671
+Node: POSIX Floating Point Problems906820
+Ref: POSIX Floating Point Problems-Footnote-1910699
+Node: Floating point summary910737
+Node: Dynamic Extensions912924
+Node: Extension Intro914476
+Node: Plugin License915741
+Node: Extension Mechanism Outline916538
+Ref: figure-load-extension916966
+Ref: figure-register-new-function918446
+Ref: figure-call-new-function919450
+Node: Extension API Description921437
+Node: Extension API Functions Introduction922887
+Node: General Data Types927708
+Ref: General Data Types-Footnote-1933608
+Node: Memory Allocation Functions933907
+Ref: Memory Allocation Functions-Footnote-1936746
+Node: Constructor Functions936845
+Node: Registration Functions938584
+Node: Extension Functions939269
+Node: Exit Callback Functions941566
+Node: Extension Version String942814
+Node: Input Parsers943477
+Node: Output Wrappers953352
+Node: Two-way processors957865
+Node: Printing Messages960128
+Ref: Printing Messages-Footnote-1961204
+Node: Updating `ERRNO'961356
+Node: Requesting Values962096
+Ref: table-value-types-returned962823
+Node: Accessing Parameters963780
+Node: Symbol Table Access965014
+Node: Symbol table by name965528
+Node: Symbol table by cookie967548
+Ref: Symbol table by cookie-Footnote-1971693
+Node: Cached values971756
+Ref: Cached values-Footnote-1975252
+Node: Array Manipulation975343
+Ref: Array Manipulation-Footnote-1976441
+Node: Array Data Types976478
+Ref: Array Data Types-Footnote-1979133
+Node: Array Functions979225
+Node: Flattening Arrays983084
+Node: Creating Arrays989986
+Node: Extension API Variables994757
+Node: Extension Versioning995393
+Node: Extension API Informational Variables997284
+Node: Extension API Boilerplate998349
+Node: Finding Extensions1002158
+Node: Extension Example1002718
+Node: Internal File Description1003490
+Node: Internal File Ops1007557
+Ref: Internal File Ops-Footnote-11019308
+Node: Using Internal File Ops1019448
+Ref: Using Internal File Ops-Footnote-11021831
+Node: Extension Samples1022104
+Node: Extension Sample File Functions1023632
+Node: Extension Sample Fnmatch1031313
+Node: Extension Sample Fork1032801
+Node: Extension Sample Inplace1034016
+Node: Extension Sample Ord1036102
+Node: Extension Sample Readdir1036938
+Ref: table-readdir-file-types1037815
+Node: Extension Sample Revout1038626
+Node: Extension Sample Rev2way1039215
+Node: Extension Sample Read write array1039955
+Node: Extension Sample Readfile1041895
+Node: Extension Sample Time1042990
+Node: Extension Sample API Tests1044338
+Node: gawkextlib1044829
+Node: Extension summary1047507
+Node: Extension Exercises1051196
+Node: Language History1052692
+Node: V7/SVR3.11054348
+Node: SVR41056501
+Node: POSIX1057935
+Node: BTL1059316
+Node: POSIX/GNU1060047
+Node: Feature History1065568
+Node: Common Extensions1078666
+Node: Ranges and Locales1080038
+Ref: Ranges and Locales-Footnote-11084657
+Ref: Ranges and Locales-Footnote-21084684
+Ref: Ranges and Locales-Footnote-31084919
+Node: Contributors1085140
+Node: History summary1090680
+Node: Installation1092059
+Node: Gawk Distribution1093005
+Node: Getting1093489
+Node: Extracting1094312
+Node: Distribution contents1095949
+Node: Unix Installation1101703
+Node: Quick Installation1102320
+Node: Additional Configuration Options1104744
+Node: Configuration Philosophy1106547
+Node: Non-Unix Installation1108916
+Node: PC Installation1109374
+Node: PC Binary Installation1110694
+Node: PC Compiling1112542
+Ref: PC Compiling-Footnote-11115563
+Node: PC Testing1115672
+Node: PC Using1116848
+Node: Cygwin1120963
+Node: MSYS1121733
+Node: VMS Installation1122234
+Node: VMS Compilation1123026
+Ref: VMS Compilation-Footnote-11124255
+Node: VMS Dynamic Extensions1124313
+Node: VMS Installation Details1125997
+Node: VMS Running1128248
+Node: VMS GNV1131088
+Node: VMS Old Gawk1131823
+Node: Bugs1132293
+Node: Other Versions1136182
+Node: Installation summary1142616
+Node: Notes1143675
+Node: Compatibility Mode1144540
+Node: Additions1145322
+Node: Accessing The Source1146247
+Node: Adding Code1147682
+Node: New Ports1153839
+Node: Derived Files1158321
+Ref: Derived Files-Footnote-11163796
+Ref: Derived Files-Footnote-21163830
+Ref: Derived Files-Footnote-31164426
+Node: Future Extensions1164540
+Node: Implementation Limitations1165146
+Node: Extension Design1166394
+Node: Old Extension Problems1167548
+Ref: Old Extension Problems-Footnote-11169065
+Node: Extension New Mechanism Goals1169122
+Ref: Extension New Mechanism Goals-Footnote-11172482
+Node: Extension Other Design Decisions1172671
+Node: Extension Future Growth1174779
+Node: Old Extension Mechanism1175615
+Node: Notes summary1177377
+Node: Basic Concepts1178563
+Node: Basic High Level1179244
+Ref: figure-general-flow1179516
+Ref: figure-process-flow1180115
+Ref: Basic High Level-Footnote-11183344
+Node: Basic Data Typing1183529
+Node: Glossary1186857
+Node: Copying1218786
+Node: GNU Free Documentation License1256342
+Node: Index1281478
 
 End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 80f8528..d23b212 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -20344,10 +20344,23 @@ Remember that you must supply a leading @samp{@@} in 
front of an indirect functi
 
 Starting with @value{PVERSION} 4.1.2 of @command{gawk}, indirect function
 calls may also be used with built-in functions and with extension functions
-(@pxref{Dynamic Extensions}).  The only thing you cannot do is pass a regular
-expression constant to a built-in function through an indirect function
address@hidden may change in a future version; recheck the documentation that
-comes with your version of @command{gawk} to see if it has.}
+(@pxref{Dynamic Extensions}). There are some limitations when calling
+built-in functions indirectly, as follows.
+
address@hidden @value{BULLET}
address@hidden
+You cannot pass a regular expression constant to a built-in function
+through an indirect function address@hidden may change in a future
+version; recheck the documentation that comes with your version of
address@hidden to see if it has.} This applies to the @code{sub()},
address@hidden()}, @code{gensub()}, @code{match()}, @code{split()} and
address@hidden()} functions.
+
address@hidden
+If calling @code{sub()} or @code{gsub()}, you may only pass two arguments,
+since those functions are unusual in that they update their third argument.
+This means that @code{$0} will be updated.
address@hidden itemize
 
 @command{gawk} does its best to make indirect function calls efficient.
 For example, in the following case:
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index cf66997..8e7d401 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -19465,10 +19465,23 @@ Remember that you must supply a leading @samp{@@} in 
front of an indirect functi
 
 Starting with @value{PVERSION} 4.1.2 of @command{gawk}, indirect function
 calls may also be used with built-in functions and with extension functions
-(@pxref{Dynamic Extensions}).  The only thing you cannot do is pass a regular
-expression constant to a built-in function through an indirect function
address@hidden may change in a future version; recheck the documentation that
-comes with your version of @command{gawk} to see if it has.}
+(@pxref{Dynamic Extensions}). There are some limitations when calling
+built-in functions indirectly, as follows.
+
address@hidden @value{BULLET}
address@hidden
+You cannot pass a regular expression constant to a built-in function
+through an indirect function address@hidden may change in a future
+version; recheck the documentation that comes with your version of
address@hidden to see if it has.} This applies to the @code{sub()},
address@hidden()}, @code{gensub()}, @code{match()}, @code{split()} and
address@hidden()} functions.
+
address@hidden
+If calling @code{sub()} or @code{gsub()}, you may only pass two arguments,
+since those functions are unusual in that they update their third argument.
+This means that @code{$0} will be updated.
address@hidden itemize
 
 @command{gawk} does its best to make indirect function calls efficient.
 For example, in the following case:

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=67d5cc4c4034f16a2390e30d8e988713e5aedb68

commit 67d5cc4c4034f16a2390e30d8e988713e5aedb68
Author: Arnold D. Robbins <address@hidden>
Date:   Tue Mar 31 22:13:41 2015 +0300

    Add tests for indirect call of builtins.

diff --git a/test/ChangeLog b/test/ChangeLog
index ab7a216..38ae4d3 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-31         Arnold D. Robbins     <address@hidden>
+
+       * Makefile.am (indirectbuiltin): New test.
+       * indirectbuiltin.awk, indirectbuiltin.ok: New files.
+
 2015-03-24         Arnold D. Robbins     <address@hidden>
 
        * id.ok: Update after fixes in code.
diff --git a/test/Makefile.am b/test/Makefile.am
index f1a0a27..ec15fcd 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -429,6 +429,8 @@ EXTRA_DIST = \
        include.awk \
        include.ok \
        include2.ok \
+       indirectbuiltin.awk \
+       indirectbuiltin.ok \
        indirectcall.awk \
        indirectcall.in \
        indirectcall.ok \
@@ -1043,7 +1045,7 @@ GAWK_EXT_TESTS = \
        genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
        icasefs icasers id igncdym igncfs ignrcas2 ignrcase \
        incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \
-       include include2 indirectcall indirectcall2 \
+       include include2 indirectbuiltin indirectcall indirectcall2 \
        lint lintold lintwarn \
        manyfiles match1 match2 match3 mbstr1 \
        nastyparm next nondec nondec2 \
diff --git a/test/Makefile.in b/test/Makefile.in
index b794e04..e265658 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -686,6 +686,8 @@ EXTRA_DIST = \
        include.awk \
        include.ok \
        include2.ok \
+       indirectbuiltin.awk \
+       indirectbuiltin.ok \
        indirectcall.awk \
        indirectcall.in \
        indirectcall.ok \
@@ -1299,7 +1301,7 @@ GAWK_EXT_TESTS = \
        genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
        icasefs icasers id igncdym igncfs ignrcas2 ignrcase \
        incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \
-       include include2 indirectcall indirectcall2 \
+       include include2 indirectbuiltin indirectcall indirectcall2 \
        lint lintold lintwarn \
        manyfiles match1 match2 match3 mbstr1 \
        nastyparm next nondec nondec2 \
@@ -3586,6 +3588,11 @@ include:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+indirectbuiltin:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 indirectcall:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 8c27086..f36e495 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1107,6 +1107,11 @@ include:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+indirectbuiltin:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 indirectcall:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/indirectbuitin.awk b/test/indirectbuiltin.awk
similarity index 100%
rename from indirectbuitin.awk
rename to test/indirectbuiltin.awk
diff --git a/test/indirectbuiltin.ok b/test/indirectbuiltin.ok
new file mode 100644
index 0000000..312bbd7
--- /dev/null
+++ b/test/indirectbuiltin.ok
@@ -0,0 +1,43 @@
+math: and: pass
+math: atan2: pass
+math: compl: pass
+math: cos: pass
+math: exp: pass
+math: int: pass
+math: log: pass
+math: lshift: pass
+math: or: pass
+math: rand: pass
+math: rshift: pass
+math: sin: pass
+math: sqrt: pass
+math: srand: pass
+math: xor: pass
+string: gensub: pass
+string: gsub: pass
+string: index: pass
+string: dcgettext: pass
+string: dcngettext: pass
+string: length: pass
+string: sprintf: pass
+string: strtonum: pass
+string: sub: pass
+string: substr: pass
+string: tolower: pass
+string: toupper: pass
+time: mktime: pass
+time: strftime: pass
+time: systime: pass
+regexp: match: pass
+regexp: patsplit: pass
+regexp: patsplit: pass
+regexp: patsplit: pass
+regexp: split: pass
+regexp: split: pass
+regexp: split: pass
+array: asort: pass
+array: asorti: pass
+array: isarray: pass
+i/o: fflush: pass
+i/o: close: pass
+i/o: system: pass

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a47af3141cf4a6b43e20db872e2b45ff9abb071f

commit a47af3141cf4a6b43e20db872e2b45ff9abb071f
Author: Arnold D. Robbins <address@hidden>
Date:   Tue Mar 31 22:07:53 2015 +0300

    Get indirect calls working!

diff --git a/ChangeLog b/ChangeLog
index 47ef45e..4b7766d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2015-03-31         Arnold D. Robbins     <address@hidden>
 
+       * awk.h (call_sub): Renamed from call_sub_func.
+       (call_match, call_split_func): Declare.
+       * builtin.c (call_sub): Renamed from call_sub_func.
+       (call_match, call_split_func): New functions.
+       * interpret.h (r_interpret): Call new functions as appropriate.
+       * node.c (r_unref): Revert change to handle Node_regex, not needed.
+
+2015-03-31         Arnold D. Robbins     <address@hidden>
+
        * awk.h (r_get_field): Declare.
        * builtin.c (call_sub_func): Rearrange the stack to be what
        the buitin function expects.
diff --git a/awk.h b/awk.h
index 1205401..4ac32e4 100644
--- a/awk.h
+++ b/awk.h
@@ -1361,7 +1361,9 @@ extern NODE *do_rand(int nargs);
 extern NODE *do_srand(int nargs);
 extern NODE *do_match(int nargs);
 extern NODE *do_sub(int nargs, unsigned int flags);
-extern NODE *call_sub_func(const char *name, int nargs);
+extern NODE *call_sub(const char *name, int nargs);
+extern NODE *call_match(int nargs);
+extern NODE *call_split_func(const char *name, int nargs);
 extern NODE *format_tree(const char *, size_t, NODE **, long);
 extern NODE *do_lshift(int nargs);
 extern NODE *do_rshift(int nargs);
diff --git a/builtin.c b/builtin.c
index c222ce7..dde3121 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2994,10 +2994,10 @@ done:
        return make_number((AWKNUM) matches);
 }
 
-/* call_sub_func --- call do_sub indirectly */
+/* call_sub --- call do_sub indirectly */
 
 NODE *
-call_sub_func(const char *name, int nargs)
+call_sub(const char *name, int nargs)
 {
        unsigned int flags = 0;
        NODE *regex, *replace, *glob_flag;
@@ -3070,6 +3070,70 @@ call_sub_func(const char *name, int nargs)
        return result;
 }
 
+/* call_match --- call do_match indirectly */
+
+NODE *
+call_match(int nargs)
+{
+       NODE *regex, *text, *array;
+       NODE *result;
+
+       regex = text = array = NULL;
+       if (nargs == 3)
+               array = POP();
+       regex = POP();
+
+       /* Don't need to pop the string just to push it back ... */
+
+       regex = make_regnode(Node_regex, regex);
+       PUSH(regex);
+
+       if (array)
+               PUSH(array);
+
+       result = do_match(nargs);
+       return result;
+}
+
+/* call_split_func --- call do_split or do_pat_split indirectly */
+
+NODE *
+call_split_func(const char *name, int nargs)
+{
+       NODE *regex, *seps;
+       NODE *result;
+
+       regex = seps = NULL;
+       if (nargs < 2)
+               fatal(_("indirect call to %s requires at least two arguments"),
+                               name);
+
+       if (nargs == 4)
+               seps = POP();
+
+       if (nargs >= 3) {
+               regex = POP_STRING();
+               regex = make_regnode(Node_regex, regex);
+       } else {
+               if (name[0] == 's') {
+                       regex = make_regnode(Node_regex, FS_node->var_value);
+                       regex->re_flags |= FS_DFLT;
+               } else
+                       regex = make_regnode(Node_regex, FPAT_node->var_value);
+               nargs++;
+       }
+
+       /* Don't need to pop the string or the data array */
+
+       PUSH(regex);
+
+       if (seps)
+               PUSH(seps);
+
+       result = (name[0] == 's') ? do_split(nargs) : do_patsplit(nargs);
+
+       return result;
+}
 
 /* make_integer - Convert an integer to a number node.  */
 
diff --git a/indirectbuitin.awk b/indirectbuitin.awk
index de3d5cc..4d5291d 100644
--- a/indirectbuitin.awk
+++ b/indirectbuitin.awk
@@ -2,9 +2,11 @@ function print_result(category, fname, builtin_result, 
indirect_result)
 {
        if (builtin_result == indirect_result)
                printf("%s: %s: pass\n", category, fname)
-       else
+       else {
                printf("%s: %s: fail: builtin: %s \tindirect: %s\n", category, 
fname,
                                builtin_result, indirect_result)
+               exit 1
+       }
 }
 
 
@@ -189,14 +191,129 @@ BEGIN {
 
 # regexp functions
 
-#      fun = "match"
-#      print_result("regexp", fun, b1, i1)
+       fun = "match"
+       b1 = match("o+", "fooob")
+       rstart = RSTART
+       rlength = RLENGTH
+       i1 = @fun("o+", "fooob")
+       print_result("regexp", fun, b1, i1)
+       if (rstart != RSTART) {
+               printf("match: failure: biRSTART (%d) != iRSTART (%d)\n",
+                       rstart, RSTART)
+               exit 1
+       }
+       if (rlength != RLENGTH) {
+               printf("match: failure: biRLENGTH (%d) != iRLENGTH (%d)\n",
+                       rlength, RLENGTH)
+               exit 1
+       }
 
-#      fun = "patsplit"
-#      print_result("regexp", fun, b1, i1)
+       ############## start patsplit ##############
+       fun = "patsplit"
+       delete data
+       delete data2
+       delete seps
+       delete seps2
+       b1 = patsplit("a:b:c:d", data, ":", seps)
+       i1 = @fun("a:b:c:d", data2, ":", seps2)
+       print_result("regexp", fun, b1, i1)
+       for (i in data) {
+               if ((! (i in data2)) || data[i] != data2[i]) {
+                       printf("patsplit1a: fail: builtin data[%d] (%s) != 
indirect data[%d] (%s)\n",
+                               i, data[i], i, data2[i])
+                       exit 1
+               }
+       }
+       for (i in seps) {
+               if ((! (i in seps2)) || seps[i] != seps2[i]) {
+                       printf("patsplit1b: fail: builtin seps[%d] (%s) != 
indirect seps[%d] (%s)\n",
+                               i, seps[i], i, seps2[i])
+                       exit 1
+               }
+       }
+
+       fun = "patsplit"
+       delete data
+       delete data2
+       b1 = patsplit("a:b:c:d", data, ":")
+       i1 = @fun("a:b:c:d", data2, ":")
+       print_result("regexp", fun, b1, i1)
+       for (i in data) {
+               if ((! (i in data2)) || data[i] != data2[i]) {
+                       printf("patsplit2: fail: builtin data[%d] (%s) != 
indirect data[%d] (%s)\n",
+                               i, data[i], i, data2[i])
+                       exit 1
+               }
+       }
 
-#      fun = "split"
-#      print_result("regexp", fun, b1, i1)
+       fun = "patsplit"
+       delete data
+       delete data2
+       FPAT = "[a-z]+"
+       b1 = patsplit("a b c d", data)
+       i1 = @fun("a b c d", data2)
+       print_result("regexp", fun, b1, i1)
+       for (i in data) {
+               if ((! (i in data2)) || data[i] != data2[i]) {
+                       printf("patsplit3: fail: builtin data[%d] (%s) != 
indirect data[%d] (%s)\n",
+                               i, data[i], i, data2[i])
+                       exit 1
+               }
+       }
+       ############## end patsplit ##############
+
+       ############## start split ##############
+       fun = "split"
+       delete data
+       delete data2
+       delete seps
+       delete seps2
+       b1 = split("a:b:c:d", data, ":", seps)
+       i1 = @fun("a:b:c:d", data2, ":", seps2)
+       print_result("regexp", fun, b1, i1)
+       for (i in data) {
+               if ((! (i in data2)) || data[i] != data2[i]) {
+                       printf("split1a: fail: builtin data[%d] (%s) != 
indirect data[%d] (%s)\n",
+                               i, data[i], i, data2[i])
+                       exit 1
+               }
+       }
+       for (i in seps) {
+               if ((! (i in seps2)) || seps[i] != seps2[i]) {
+                       printf("split1b: fail: builtin seps[%d] (%s) != 
indirect seps[%d] (%s)\n",
+                               i, seps[i], i, seps2[i])
+                       exit 1
+               }
+       }
+
+       fun = "split"
+       delete data
+       delete data2
+       b1 = split("a:b:c:d", data, ":")
+       i1 = @fun("a:b:c:d", data2, ":")
+       print_result("regexp", fun, b1, i1)
+       for (i in data) {
+               if ((! (i in data2)) || data[i] != data2[i]) {
+                       printf("split2: fail: builtin data[%d] (%s) != indirect 
data[%d] (%s)\n",
+                               i, data[i], i, data2[i])
+                       exit 1
+               }
+       }
+
+       fun = "split"
+       delete data
+       delete data2
+       b1 = split("a b c d", data)
+       i1 = @fun("a b c d", data2)
+       print_result("regexp", fun, b1, i1)
+       for (i in data) {
+               if ((! (i in data2)) || data[i] != data2[i]) {
+                       printf("split3: fail: builtin data[%d] (%s) != indirect 
data[%d] (%s)\n",
+                               i, data[i], i, data2[i])
+                       exit 1
+               }
+       }
+       ############## end split ##############
 
 # array functions
 
diff --git a/interpret.h b/interpret.h
index f9aa311..6dce863 100644
--- a/interpret.h
+++ b/interpret.h
@@ -1067,7 +1067,11 @@ match_re:
 
                                /* call it */
                                if (the_func == (builtin_func_t) do_sub)
-                                       r = call_sub_func(t1->stptr, arg_count);
+                                       r = call_sub(t1->stptr, arg_count);
+                               else if (the_func == do_match)
+                                       r = call_match(arg_count);
+                               else if (the_func == do_split || the_func == 
do_patsplit)
+                                       r = call_split_func(t1->stptr, 
arg_count);
                                else
                                        r = the_func(arg_count);
 
diff --git a/node.c b/node.c
index 7a1d99f..9fd4c7b 100644
--- a/node.c
+++ b/node.c
@@ -431,14 +431,6 @@ r_unref(NODE *tmp)
 #ifdef GAWKDEBUG
        if (tmp == NULL)
                return;
-       if (tmp->type == Node_regex) {
-fprintf(stderr, "got here!\n"); fflush(stderr);
-               if (tmp->re_reg != NULL)
-                       refree(tmp->re_reg);
-               if (tmp->re_text != NULL)
-                       unref(tmp->re_text);
-               goto free_the_node;
-       }
        if ((tmp->flags & MALLOC) != 0) {
                if (tmp->valref > 1) {
                        tmp->valref--;
@@ -455,7 +447,6 @@ fprintf(stderr, "got here!\n"); fflush(stderr);
        mpfr_unset(tmp);
 
        free_wstr(tmp);
-free_the_node:
        freenode(tmp);
 }
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |    9 +
 awk.h                    |    4 +-
 builtin.c                |   68 +++++-
 doc/ChangeLog            |    5 +
 doc/gawk.info            |  588 +++++++++++++++++++++++-----------------------
 doc/gawk.texi            |   21 ++-
 doc/gawktexi.in          |   21 ++-
 indirectbuitin.awk       |  254 --------------------
 interpret.h              |    6 +-
 node.c                   |    9 -
 test/ChangeLog           |    5 +
 test/Makefile.am         |    4 +-
 test/Makefile.in         |    9 +-
 test/Maketests           |    5 +
 test/indirectbuiltin.awk |  371 +++++++++++++++++++++++++++++
 test/indirectbuiltin.ok  |   43 ++++
 16 files changed, 855 insertions(+), 567 deletions(-)
 delete mode 100644 indirectbuitin.awk
 create mode 100644 test/indirectbuiltin.awk
 create mode 100644 test/indirectbuiltin.ok


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]