gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, feature/namespaces, updated. gawk-4.1.0-


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, feature/namespaces, updated. gawk-4.1.0-2617-g5cc1e51
Date: Tue, 4 Jul 2017 17:08:49 -0400 (EDT)

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/namespaces has been updated
       via  5cc1e516bb14ca6f5a6f61ab3af736e6ca97e5bb (commit)
      from  7b7d24b5f11228031ea876e3dc93390441e13d7e (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=5cc1e516bb14ca6f5a6f61ab3af736e6ca97e5bb

commit 5cc1e516bb14ca6f5a6f61ab3af736e6ca97e5bb
Author: Arnold D. Robbins <address@hidden>
Date:   Wed Jul 5 00:08:31 2017 +0300

    Namespace doc updates.

diff --git a/doc/ChangeLog b/doc/ChangeLog
index 7da61e3..9582a7f 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2017-07-05         Arnold D. Robbins     <address@hidden>
+
+       * gawktexi.in (Namespaces): More updates.
+
 2017-07-02         Arnold D. Robbins     <address@hidden>
 
        * texinfo.tex: Pull in latest from Texinfo SVN.
diff --git a/doc/gawk.info b/doc/gawk.info
index c5aee74..b76643a 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -15174,6 +15174,11 @@ and '_pw_count'.
 conventions.  You are not required to write your programs this way--we
 merely recommend that you do so.
 
+   Beginning with version *FIXME* 5.0, 'gawk' provides a powerful
+mechanism for solving the problems described in this section:
+"namespaces".  Namespaces and their use are described in detail in *note
+Namespaces::.
+
    ---------- Footnotes ----------
 
    (1) Although all the library routines could have been rewritten to
@@ -22762,7 +22767,7 @@ Profiler:
      'Op_Func' instructions.  If the namespace is different from the
      previous one, output an '@namespace' statement.  For each
      identifier, if it starts with the current namespace, output only
-     the simple part.
+     the simple part (DONE).
 
 Debugger:
      Simply print fully qualified names all the time.  Maybe allow a
@@ -22773,7 +22778,7 @@ Debugger:
 How does this affect '@include'?
      Basically '@include' should push and pop the namespace.  Each
      '@include' saves the current namespace and starts over with
-     namespace 'awk' until an '@namespace' is seen.
+     namespace 'awk' until an '@namespace' is seen (DONE).
 
 Extension functions
      Revise the current macros to pass '"awk"' as the namespace argument
@@ -22788,6 +22793,60 @@ Extension functions
      and _not_ fully qualify the name before storing it in the symbol
      table.
 
+More on Extension Functions
+       1. Function and variables names need to be simple identifiers.
+          This currently isn't checked in the code.  Allowing both
+          namespace + identifier and 'foo::bar' would be confusing to
+          document and to code and to test.
+
+       2. Function and variable names cannot be reserved words.  This
+          also is currently not checked, since such things aren't
+          accessable from normal 'awk' code.  (They could be accessed
+          indirectly via 'FUNCTAB' and/or indirect function calls, but
+          that is an accident of the current implementation and not
+          necessarily a well-thought-out design decision.  In fact, I
+          think it's a bad idea.)
+
+       3. Namespace names need to be valid identifiers.  If we ever
+          decide to limit such names to non-keywords, the same check
+          needs to be applied.
+
+       4. It's debatable if there should be a default namespace for a
+          plugin.  Should it be the plugin's name?  Probably not.
+
+       5. Should the 'ext_id', which is currently just a null pointer,
+          be made to point to something?  What would be carry around in
+          it?
+
+Additional 'gawk' built-ins
+     Based on some discussion with Andrew Schorr, I'd like to find a way
+     to change the additional 'gawk' built-in functions, like
+     'gensub()', 'strftime()', etc.  into "pre-defined" extension
+     functions in the 'awk' namespace.  This has some advantages:
+
+       1. It gives us room to add more built-ins without their being
+          reserved words to the grammar.  This in turn means that:
+
+       2. Users can define their own functions with the same name as
+          'gawk' additions as long as they put them in their own
+          namespace.
+
+     Everybody wins!
+
+     Note that POSIX-standard pre-defined 'awk' names such as 'length()'
+     and 'sub()' would remain reserved.  The following would produce a
+     syntax error:
+
+          @namespace "example"
+
+          function gsub(str, pat, result) { ... }
+
+     Whereas this would not:
+
+          @namespace "example"
+
+          function gensub(str, pat, result) { ... }
+
 
 File: gawk.info,  Node: Arbitrary Precision Arithmetic,  Next: Dynamic 
Extensions,  Prev: Namespaces,  Up: Top
 
@@ -36346,301 +36405,301 @@ Node: Library Functions629715
 Ref: Library Functions-Footnote-1633322
 Ref: Library Functions-Footnote-2633465
 Node: Library Names633636
-Ref: Library Names-Footnote-1637096
-Ref: Library Names-Footnote-2637319
-Node: General Functions637405
-Node: Strtonum Function638508
-Node: Assert Function641530
-Node: Round Function644856
-Node: Cliff Random Function646397
-Node: Ordinal Functions647413
-Ref: Ordinal Functions-Footnote-1650476
-Ref: Ordinal Functions-Footnote-2650728
-Node: Join Function650938
-Ref: Join Function-Footnote-1652708
-Node: Getlocaltime Function652908
-Node: Readfile Function656650
-Node: Shell Quoting658622
-Node: Data File Management660023
-Node: Filetrans Function660655
-Node: Rewind Function664751
-Node: File Checking666661
-Ref: File Checking-Footnote-1667995
-Node: Empty Files668196
-Node: Ignoring Assigns670175
-Node: Getopt Function671725
-Ref: Getopt Function-Footnote-1683194
-Node: Passwd Functions683394
-Ref: Passwd Functions-Footnote-1692233
-Node: Group Functions692321
-Ref: Group Functions-Footnote-1700219
-Node: Walking Arrays700426
-Node: Library Functions Summary703434
-Node: Library Exercises704840
-Node: Sample Programs705305
-Node: Running Examples706075
-Node: Clones706803
-Node: Cut Program708027
-Node: Egrep Program717956
-Ref: Egrep Program-Footnote-1725468
-Node: Id Program725578
-Node: Split Program729258
-Ref: Split Program-Footnote-1732717
-Node: Tee Program732846
-Node: Uniq Program735636
-Node: Wc Program743062
-Ref: Wc Program-Footnote-1747317
-Node: Miscellaneous Programs747411
-Node: Dupword Program748624
-Node: Alarm Program750654
-Node: Translate Program755509
-Ref: Translate Program-Footnote-1760074
-Node: Labels Program760344
-Ref: Labels Program-Footnote-1763695
-Node: Word Sorting763779
-Node: History Sorting767851
-Node: Extract Program769686
-Node: Simple Sed777215
-Node: Igawk Program780289
-Ref: Igawk Program-Footnote-1794620
-Ref: Igawk Program-Footnote-2794822
-Ref: Igawk Program-Footnote-3794944
-Node: Anagram Program795059
-Node: Signature Program798121
-Node: Programs Summary799368
-Node: Programs Exercises800582
-Ref: Programs Exercises-Footnote-1804711
-Node: Advanced Features804802
-Node: Nondecimal Data806792
-Node: Array Sorting808383
-Node: Controlling Array Traversal809083
-Ref: Controlling Array Traversal-Footnote-1817450
-Node: Array Sorting Functions817568
-Ref: Array Sorting Functions-Footnote-1822659
-Node: Two-way I/O822855
-Ref: Two-way I/O-Footnote-1829406
-Ref: Two-way I/O-Footnote-2829593
-Node: TCP/IP Networking829675
-Node: Profiling832793
-Ref: Profiling-Footnote-1841465
-Node: Advanced Features Summary841788
-Node: Internationalization843632
-Node: I18N and L10N845112
-Node: Explaining gettext845799
-Ref: Explaining gettext-Footnote-1851691
-Ref: Explaining gettext-Footnote-2851876
-Node: Programmer i18n852041
-Ref: Programmer i18n-Footnote-1856990
-Node: Translator i18n857039
-Node: String Extraction857833
-Ref: String Extraction-Footnote-1858965
-Node: Printf Ordering859051
-Ref: Printf Ordering-Footnote-1861837
-Node: I18N Portability861901
-Ref: I18N Portability-Footnote-1864357
-Node: I18N Example864420
-Ref: I18N Example-Footnote-1867226
-Node: Gawk I18N867299
-Node: I18N Summary867944
-Node: Debugger869285
-Node: Debugging870287
-Node: Debugging Concepts870728
-Node: Debugging Terms872537
-Node: Awk Debugging875112
-Node: Sample Debugging Session876018
-Node: Debugger Invocation876552
-Node: Finding The Bug877938
-Node: List of Debugger Commands884416
-Node: Breakpoint Control885749
-Node: Debugger Execution Control889443
-Node: Viewing And Changing Data892805
-Node: Execution Stack896179
-Node: Debugger Info897816
-Node: Miscellaneous Debugger Commands901887
-Node: Readline Support906975
-Node: Limitations907871
-Node: Debugging Summary909980
-Node: Namespaces911259
-Node: Global Namespace911945
-Node: Qualified Names913292
-Node: Default Namespace914672
-Node: Changing The Namespace915449
-Node: Internal Name Management916661
-Node: Namespace Example917682
-Node: Namespace Misc919751
-Node: Arbitrary Precision Arithmetic921312
-Node: Computer Arithmetic922799
-Ref: table-numeric-ranges926390
-Ref: Computer Arithmetic-Footnote-1927112
-Node: Math Definitions927169
-Ref: table-ieee-formats930483
-Ref: Math Definitions-Footnote-1931086
-Node: MPFR features931191
-Node: FP Math Caution932908
-Ref: FP Math Caution-Footnote-1933980
-Node: Inexactness of computations934349
-Node: Inexact representation935309
-Node: Comparing FP Values936669
-Node: Errors accumulate937751
-Node: Getting Accuracy939184
-Node: Try To Round941894
-Node: Setting precision942793
-Ref: table-predefined-precision-strings943490
-Node: Setting the rounding mode945320
-Ref: table-gawk-rounding-modes945694
-Ref: Setting the rounding mode-Footnote-1949102
-Node: Arbitrary Precision Integers949281
-Ref: Arbitrary Precision Integers-Footnote-1954186
-Node: Checking for MPFR954335
-Node: POSIX Floating Point Problems955632
-Ref: POSIX Floating Point Problems-Footnote-1959503
-Node: Floating point summary959541
-Node: Dynamic Extensions961731
-Node: Extension Intro963284
-Node: Plugin License964550
-Node: Extension Mechanism Outline965347
-Ref: figure-load-extension965786
-Ref: figure-register-new-function967351
-Ref: figure-call-new-function968443
-Node: Extension API Description970505
-Node: Extension API Functions Introduction972147
-Node: General Data Types977481
-Ref: General Data Types-Footnote-1984686
-Node: Memory Allocation Functions984985
-Ref: Memory Allocation Functions-Footnote-1988137
-Node: Constructor Functions988236
-Node: Registration Functions991235
-Node: Extension Functions991920
-Node: Exit Callback Functions997133
-Node: Extension Version String998383
-Node: Input Parsers999046
-Node: Output Wrappers1011753
-Node: Two-way processors1016265
-Node: Printing Messages1018530
-Ref: Printing Messages-Footnote-11019701
-Node: Updating ERRNO1019854
-Node: Requesting Values1020593
-Ref: table-value-types-returned1021330
-Node: Accessing Parameters1022266
-Node: Symbol Table Access1023501
-Node: Symbol table by name1024013
-Node: Symbol table by cookie1025802
-Ref: Symbol table by cookie-Footnote-11029987
-Node: Cached values1030051
-Ref: Cached values-Footnote-11033587
-Node: Array Manipulation1033678
-Ref: Array Manipulation-Footnote-11034769
-Node: Array Data Types1034806
-Ref: Array Data Types-Footnote-11037464
-Node: Array Functions1037556
-Node: Flattening Arrays1041955
-Node: Creating Arrays1048896
-Node: Redirection API1053665
-Node: Extension API Variables1056507
-Node: Extension Versioning1057140
-Ref: gawk-api-version1057577
-Node: Extension API Informational Variables1059305
-Node: Extension API Boilerplate1060369
-Node: Changes from API V11064231
-Node: Finding Extensions1064891
-Node: Extension Example1065450
-Node: Internal File Description1066248
-Node: Internal File Ops1070328
-Ref: Internal File Ops-Footnote-11081728
-Node: Using Internal File Ops1081868
-Ref: Using Internal File Ops-Footnote-11084251
-Node: Extension Samples1084525
-Node: Extension Sample File Functions1086054
-Node: Extension Sample Fnmatch1093703
-Node: Extension Sample Fork1095190
-Node: Extension Sample Inplace1096408
-Node: Extension Sample Ord1099625
-Node: Extension Sample Readdir1100461
-Ref: table-readdir-file-types1101350
-Node: Extension Sample Revout1102155
-Node: Extension Sample Rev2way1102744
-Node: Extension Sample Read write array1103484
-Node: Extension Sample Readfile1105426
-Node: Extension Sample Time1106521
-Node: Extension Sample API Tests1107869
-Node: gawkextlib1108361
-Node: Extension summary1110808
-Node: Extension Exercises1114510
-Node: Language History1116008
-Node: V7/SVR3.11117664
-Node: SVR41119816
-Node: POSIX1121250
-Node: BTL1122629
-Node: POSIX/GNU1123358
-Node: Feature History1129250
-Node: Common Extensions1143674
-Node: Ranges and Locales1144957
-Ref: Ranges and Locales-Footnote-11149573
-Ref: Ranges and Locales-Footnote-21149600
-Ref: Ranges and Locales-Footnote-31149835
-Node: Contributors1150056
-Node: History summary1155616
-Node: Installation1156996
-Node: Gawk Distribution1157940
-Node: Getting1158424
-Node: Extracting1159385
-Node: Distribution contents1161023
-Node: Unix Installation1167365
-Node: Quick Installation1168047
-Node: Shell Startup Files1170461
-Node: Additional Configuration Options1171550
-Node: Configuration Philosophy1173539
-Node: Non-Unix Installation1175908
-Node: PC Installation1176368
-Node: PC Binary Installation1177206
-Node: PC Compiling1177641
-Node: PC Using1178758
-Node: Cygwin1181803
-Node: MSYS1182573
-Node: VMS Installation1183074
-Node: VMS Compilation1183865
-Ref: VMS Compilation-Footnote-11185094
-Node: VMS Dynamic Extensions1185152
-Node: VMS Installation Details1186837
-Node: VMS Running1189090
-Node: VMS GNV1193369
-Node: VMS Old Gawk1194104
-Node: Bugs1194575
-Node: Bug address1195238
-Node: Usenet1197635
-Node: Maintainers1198412
-Node: Other Versions1199788
-Node: Installation summary1206372
-Node: Notes1207407
-Node: Compatibility Mode1208272
-Node: Additions1209054
-Node: Accessing The Source1209979
-Node: Adding Code1211414
-Node: New Ports1217632
-Node: Derived Files1222120
-Ref: Derived Files-Footnote-11227605
-Ref: Derived Files-Footnote-21227640
-Ref: Derived Files-Footnote-31228238
-Node: Future Extensions1228352
-Node: Implementation Limitations1229010
-Node: Extension Design1230193
-Node: Old Extension Problems1231347
-Ref: Old Extension Problems-Footnote-11232865
-Node: Extension New Mechanism Goals1232922
-Ref: Extension New Mechanism Goals-Footnote-11236286
-Node: Extension Other Design Decisions1236475
-Node: Extension Future Growth1238588
-Node: Old Extension Mechanism1239424
-Node: Notes summary1241187
-Node: Basic Concepts1242369
-Node: Basic High Level1243050
-Ref: figure-general-flow1243332
-Ref: figure-process-flow1244017
-Ref: Basic High Level-Footnote-11247318
-Node: Basic Data Typing1247503
-Node: Glossary1250831
-Node: Copying1282778
-Node: GNU Free Documentation License1320317
-Node: Index1345435
+Ref: Library Names-Footnote-1637312
+Ref: Library Names-Footnote-2637535
+Node: General Functions637621
+Node: Strtonum Function638724
+Node: Assert Function641746
+Node: Round Function645072
+Node: Cliff Random Function646613
+Node: Ordinal Functions647629
+Ref: Ordinal Functions-Footnote-1650692
+Ref: Ordinal Functions-Footnote-2650944
+Node: Join Function651154
+Ref: Join Function-Footnote-1652924
+Node: Getlocaltime Function653124
+Node: Readfile Function656866
+Node: Shell Quoting658838
+Node: Data File Management660239
+Node: Filetrans Function660871
+Node: Rewind Function664967
+Node: File Checking666877
+Ref: File Checking-Footnote-1668211
+Node: Empty Files668412
+Node: Ignoring Assigns670391
+Node: Getopt Function671941
+Ref: Getopt Function-Footnote-1683410
+Node: Passwd Functions683610
+Ref: Passwd Functions-Footnote-1692449
+Node: Group Functions692537
+Ref: Group Functions-Footnote-1700435
+Node: Walking Arrays700642
+Node: Library Functions Summary703650
+Node: Library Exercises705056
+Node: Sample Programs705521
+Node: Running Examples706291
+Node: Clones707019
+Node: Cut Program708243
+Node: Egrep Program718172
+Ref: Egrep Program-Footnote-1725684
+Node: Id Program725794
+Node: Split Program729474
+Ref: Split Program-Footnote-1732933
+Node: Tee Program733062
+Node: Uniq Program735852
+Node: Wc Program743278
+Ref: Wc Program-Footnote-1747533
+Node: Miscellaneous Programs747627
+Node: Dupword Program748840
+Node: Alarm Program750870
+Node: Translate Program755725
+Ref: Translate Program-Footnote-1760290
+Node: Labels Program760560
+Ref: Labels Program-Footnote-1763911
+Node: Word Sorting763995
+Node: History Sorting768067
+Node: Extract Program769902
+Node: Simple Sed777431
+Node: Igawk Program780505
+Ref: Igawk Program-Footnote-1794836
+Ref: Igawk Program-Footnote-2795038
+Ref: Igawk Program-Footnote-3795160
+Node: Anagram Program795275
+Node: Signature Program798337
+Node: Programs Summary799584
+Node: Programs Exercises800798
+Ref: Programs Exercises-Footnote-1804927
+Node: Advanced Features805018
+Node: Nondecimal Data807008
+Node: Array Sorting808599
+Node: Controlling Array Traversal809299
+Ref: Controlling Array Traversal-Footnote-1817666
+Node: Array Sorting Functions817784
+Ref: Array Sorting Functions-Footnote-1822875
+Node: Two-way I/O823071
+Ref: Two-way I/O-Footnote-1829622
+Ref: Two-way I/O-Footnote-2829809
+Node: TCP/IP Networking829891
+Node: Profiling833009
+Ref: Profiling-Footnote-1841681
+Node: Advanced Features Summary842004
+Node: Internationalization843848
+Node: I18N and L10N845328
+Node: Explaining gettext846015
+Ref: Explaining gettext-Footnote-1851907
+Ref: Explaining gettext-Footnote-2852092
+Node: Programmer i18n852257
+Ref: Programmer i18n-Footnote-1857206
+Node: Translator i18n857255
+Node: String Extraction858049
+Ref: String Extraction-Footnote-1859181
+Node: Printf Ordering859267
+Ref: Printf Ordering-Footnote-1862053
+Node: I18N Portability862117
+Ref: I18N Portability-Footnote-1864573
+Node: I18N Example864636
+Ref: I18N Example-Footnote-1867442
+Node: Gawk I18N867515
+Node: I18N Summary868160
+Node: Debugger869501
+Node: Debugging870503
+Node: Debugging Concepts870944
+Node: Debugging Terms872753
+Node: Awk Debugging875328
+Node: Sample Debugging Session876234
+Node: Debugger Invocation876768
+Node: Finding The Bug878154
+Node: List of Debugger Commands884632
+Node: Breakpoint Control885965
+Node: Debugger Execution Control889659
+Node: Viewing And Changing Data893021
+Node: Execution Stack896395
+Node: Debugger Info898032
+Node: Miscellaneous Debugger Commands902103
+Node: Readline Support907191
+Node: Limitations908087
+Node: Debugging Summary910196
+Node: Namespaces911475
+Node: Global Namespace912161
+Node: Qualified Names913508
+Node: Default Namespace914888
+Node: Changing The Namespace915665
+Node: Internal Name Management916877
+Node: Namespace Example917898
+Node: Namespace Misc919967
+Node: Arbitrary Precision Arithmetic923709
+Node: Computer Arithmetic925196
+Ref: table-numeric-ranges928787
+Ref: Computer Arithmetic-Footnote-1929509
+Node: Math Definitions929566
+Ref: table-ieee-formats932880
+Ref: Math Definitions-Footnote-1933483
+Node: MPFR features933588
+Node: FP Math Caution935305
+Ref: FP Math Caution-Footnote-1936377
+Node: Inexactness of computations936746
+Node: Inexact representation937706
+Node: Comparing FP Values939066
+Node: Errors accumulate940148
+Node: Getting Accuracy941581
+Node: Try To Round944291
+Node: Setting precision945190
+Ref: table-predefined-precision-strings945887
+Node: Setting the rounding mode947717
+Ref: table-gawk-rounding-modes948091
+Ref: Setting the rounding mode-Footnote-1951499
+Node: Arbitrary Precision Integers951678
+Ref: Arbitrary Precision Integers-Footnote-1956583
+Node: Checking for MPFR956732
+Node: POSIX Floating Point Problems958029
+Ref: POSIX Floating Point Problems-Footnote-1961900
+Node: Floating point summary961938
+Node: Dynamic Extensions964128
+Node: Extension Intro965681
+Node: Plugin License966947
+Node: Extension Mechanism Outline967744
+Ref: figure-load-extension968183
+Ref: figure-register-new-function969748
+Ref: figure-call-new-function970840
+Node: Extension API Description972902
+Node: Extension API Functions Introduction974544
+Node: General Data Types979878
+Ref: General Data Types-Footnote-1987083
+Node: Memory Allocation Functions987382
+Ref: Memory Allocation Functions-Footnote-1990534
+Node: Constructor Functions990633
+Node: Registration Functions993632
+Node: Extension Functions994317
+Node: Exit Callback Functions999530
+Node: Extension Version String1000780
+Node: Input Parsers1001443
+Node: Output Wrappers1014150
+Node: Two-way processors1018662
+Node: Printing Messages1020927
+Ref: Printing Messages-Footnote-11022098
+Node: Updating ERRNO1022251
+Node: Requesting Values1022990
+Ref: table-value-types-returned1023727
+Node: Accessing Parameters1024663
+Node: Symbol Table Access1025898
+Node: Symbol table by name1026410
+Node: Symbol table by cookie1028199
+Ref: Symbol table by cookie-Footnote-11032384
+Node: Cached values1032448
+Ref: Cached values-Footnote-11035984
+Node: Array Manipulation1036075
+Ref: Array Manipulation-Footnote-11037166
+Node: Array Data Types1037203
+Ref: Array Data Types-Footnote-11039861
+Node: Array Functions1039953
+Node: Flattening Arrays1044352
+Node: Creating Arrays1051293
+Node: Redirection API1056062
+Node: Extension API Variables1058904
+Node: Extension Versioning1059537
+Ref: gawk-api-version1059974
+Node: Extension API Informational Variables1061702
+Node: Extension API Boilerplate1062766
+Node: Changes from API V11066628
+Node: Finding Extensions1067288
+Node: Extension Example1067847
+Node: Internal File Description1068645
+Node: Internal File Ops1072725
+Ref: Internal File Ops-Footnote-11084125
+Node: Using Internal File Ops1084265
+Ref: Using Internal File Ops-Footnote-11086648
+Node: Extension Samples1086922
+Node: Extension Sample File Functions1088451
+Node: Extension Sample Fnmatch1096100
+Node: Extension Sample Fork1097587
+Node: Extension Sample Inplace1098805
+Node: Extension Sample Ord1102022
+Node: Extension Sample Readdir1102858
+Ref: table-readdir-file-types1103747
+Node: Extension Sample Revout1104552
+Node: Extension Sample Rev2way1105141
+Node: Extension Sample Read write array1105881
+Node: Extension Sample Readfile1107823
+Node: Extension Sample Time1108918
+Node: Extension Sample API Tests1110266
+Node: gawkextlib1110758
+Node: Extension summary1113205
+Node: Extension Exercises1116907
+Node: Language History1118405
+Node: V7/SVR3.11120061
+Node: SVR41122213
+Node: POSIX1123647
+Node: BTL1125026
+Node: POSIX/GNU1125755
+Node: Feature History1131647
+Node: Common Extensions1146071
+Node: Ranges and Locales1147354
+Ref: Ranges and Locales-Footnote-11151970
+Ref: Ranges and Locales-Footnote-21151997
+Ref: Ranges and Locales-Footnote-31152232
+Node: Contributors1152453
+Node: History summary1158013
+Node: Installation1159393
+Node: Gawk Distribution1160337
+Node: Getting1160821
+Node: Extracting1161782
+Node: Distribution contents1163420
+Node: Unix Installation1169762
+Node: Quick Installation1170444
+Node: Shell Startup Files1172858
+Node: Additional Configuration Options1173947
+Node: Configuration Philosophy1175936
+Node: Non-Unix Installation1178305
+Node: PC Installation1178765
+Node: PC Binary Installation1179603
+Node: PC Compiling1180038
+Node: PC Using1181155
+Node: Cygwin1184200
+Node: MSYS1184970
+Node: VMS Installation1185471
+Node: VMS Compilation1186262
+Ref: VMS Compilation-Footnote-11187491
+Node: VMS Dynamic Extensions1187549
+Node: VMS Installation Details1189234
+Node: VMS Running1191487
+Node: VMS GNV1195766
+Node: VMS Old Gawk1196501
+Node: Bugs1196972
+Node: Bug address1197635
+Node: Usenet1200032
+Node: Maintainers1200809
+Node: Other Versions1202185
+Node: Installation summary1208769
+Node: Notes1209804
+Node: Compatibility Mode1210669
+Node: Additions1211451
+Node: Accessing The Source1212376
+Node: Adding Code1213811
+Node: New Ports1220029
+Node: Derived Files1224517
+Ref: Derived Files-Footnote-11230002
+Ref: Derived Files-Footnote-21230037
+Ref: Derived Files-Footnote-31230635
+Node: Future Extensions1230749
+Node: Implementation Limitations1231407
+Node: Extension Design1232590
+Node: Old Extension Problems1233744
+Ref: Old Extension Problems-Footnote-11235262
+Node: Extension New Mechanism Goals1235319
+Ref: Extension New Mechanism Goals-Footnote-11238683
+Node: Extension Other Design Decisions1238872
+Node: Extension Future Growth1240985
+Node: Old Extension Mechanism1241821
+Node: Notes summary1243584
+Node: Basic Concepts1244766
+Node: Basic High Level1245447
+Ref: figure-general-flow1245729
+Ref: figure-process-flow1246414
+Ref: Basic High Level-Footnote-11249715
+Node: Basic Data Typing1249900
+Node: Glossary1253228
+Node: Copying1285175
+Node: GNU Free Documentation License1322714
+Node: Index1347832
 
 End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 60ab6e0..d885c0b 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -21510,6 +21510,11 @@ The conventions presented in this @value{SECTION} are 
exactly
 that: conventions. You are not required to write your programs this
 way---we merely recommend that you do so.
 
+Beginning with version @strong{FIXME} 5.0, @command{gawk} provides
+a powerful mechanism for solving the problems described in this
+section: @dfn{namespaces}.  Namespaces and their use are described
+in detail in @ref{Namespaces}.
+
 @node General Functions
 @section General Programming
 
@@ -31475,7 +31480,8 @@ When profiling, we include the namespace in the 
@code{Op_Rule}
 and @code{Op_Func} instructions.  If the namespace
 is different from the previous
 one, output an @samp{@@namespace} statement.  For each identifier,
-if it starts with the current namespace, output only the simple part.
+if it starts with the current namespace, output only the simple part
+(DONE).
 
 @item Debugger:
 Simply print fully qualified names all the time. Maybe allow a
@@ -31486,7 +31492,8 @@ Have to be careful about all uppercase names though.
 @item How does this affect @code{@@include}?
 Basically @code{@@include} should push and pop the namespace. Each
 @code{@@include} saves the current namespace and starts over with
-namespace @samp{awk} until an @code{@@namespace} is seen.
+namespace @samp{awk} until an @code{@@namespace} is seen
+(DONE).
 
 @item Extension functions
 Revise the current macros to pass @code{"awk"} as the namespace
@@ -31499,6 +31506,73 @@ Actually, since we've decided that @code{awk} 
namespace variables and
 function are stored unadorned, the current macros that pass @code{""}
 would continue to work. Internally, we need to recognize @code{"awk"} and
 @emph{not} fully qualify the name before storing it in the symbol table.
+
address@hidden More on Extension Functions
address@hidden 1
address@hidden
+Function and variables names need to be simple identifiers. This
+currently isn't checked in the code. Allowing both namespace + identifier
+and @code{foo::bar} would be confusing to document and to code and to test.
+
address@hidden
+Function and variable names cannot be reserved words. This also is currently
+not checked, since such things aren't accessable from normal @command{awk}
+code.  (They could be accessed indirectly via @code{FUNCTAB} and/or
+indirect function calls, but that is an accident of the current
+implementation and not necessarily a well-thought-out design decision.
+In fact, I think it's a bad idea.)
+
address@hidden
+Namespace names need to be valid identifiers. If we ever decide to
+limit such names to non-keywords, the same check needs to be applied.
+
address@hidden
+It's debatable if there should be a default namespace for a plugin.
+Should it be the plugin's name?  Probably not.
+
address@hidden
+Should the @code{ext_id}, which is currently just a null pointer,
+be made to point to something?  What would be carry around in it?
address@hidden enumerate
+
address@hidden Additional @command{gawk} built-ins
+Based on some discussion with Andrew Schorr, I'd like to find a way
+to change the additional @command{gawk} built-in functions, like
address@hidden()}, @code{strftime()}, etc. into ``pre-defined''
+extension functions in the @samp{awk} namespace.  This has some
+advantages:
+
address@hidden 1
address@hidden
+It gives us room to add more built-ins without their being reserved
+words to the grammar.  This in turn means that:
+
address@hidden
+Users can define their own functions with the same name as @command{gawk}
+additions as long as they put them in their own namespace.
address@hidden enumerate
+
+Everybody wins!
+
+Note that POSIX-standard pre-defined @command{awk} names such as 
@command{length()}
+and @command{sub()} would remain reserved. The following would produce
+a syntax error:
+
address@hidden
+@@namespace "example"
+
+function gsub(str, pat, result) @{ @dots{} @}
address@hidden example
+
address@hidden
+Whereas this would not:
+
address@hidden
+@@namespace "example"
+
+function gensub(str, pat, result) @{ @dots{} @}
address@hidden example
+
 @end table
 
 @node Arbitrary Precision Arithmetic
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 60e7bcf..56e1bc5 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -20554,6 +20554,11 @@ The conventions presented in this @value{SECTION} are 
exactly
 that: conventions. You are not required to write your programs this
 way---we merely recommend that you do so.
 
+Beginning with version @strong{FIXME} 5.0, @command{gawk} provides
+a powerful mechanism for solving the problems described in this
+section: @dfn{namespaces}.  Namespaces and their use are described
+in detail in @ref{Namespaces}.
+
 @node General Functions
 @section General Programming
 
@@ -30489,7 +30494,8 @@ When profiling, we include the namespace in the 
@code{Op_Rule}
 and @code{Op_Func} instructions.  If the namespace
 is different from the previous
 one, output an @samp{@@namespace} statement.  For each identifier,
-if it starts with the current namespace, output only the simple part.
+if it starts with the current namespace, output only the simple part
+(DONE).
 
 @item Debugger:
 Simply print fully qualified names all the time. Maybe allow a
@@ -30500,7 +30506,8 @@ Have to be careful about all uppercase names though.
 @item How does this affect @code{@@include}?
 Basically @code{@@include} should push and pop the namespace. Each
 @code{@@include} saves the current namespace and starts over with
-namespace @samp{awk} until an @code{@@namespace} is seen.
+namespace @samp{awk} until an @code{@@namespace} is seen
+(DONE).
 
 @item Extension functions
 Revise the current macros to pass @code{"awk"} as the namespace
@@ -30513,6 +30520,73 @@ Actually, since we've decided that @code{awk} 
namespace variables and
 function are stored unadorned, the current macros that pass @code{""}
 would continue to work. Internally, we need to recognize @code{"awk"} and
 @emph{not} fully qualify the name before storing it in the symbol table.
+
address@hidden More on Extension Functions
address@hidden 1
address@hidden
+Function and variables names need to be simple identifiers. This
+currently isn't checked in the code. Allowing both namespace + identifier
+and @code{foo::bar} would be confusing to document and to code and to test.
+
address@hidden
+Function and variable names cannot be reserved words. This also is currently
+not checked, since such things aren't accessable from normal @command{awk}
+code.  (They could be accessed indirectly via @code{FUNCTAB} and/or
+indirect function calls, but that is an accident of the current
+implementation and not necessarily a well-thought-out design decision.
+In fact, I think it's a bad idea.)
+
address@hidden
+Namespace names need to be valid identifiers. If we ever decide to
+limit such names to non-keywords, the same check needs to be applied.
+
address@hidden
+It's debatable if there should be a default namespace for a plugin.
+Should it be the plugin's name?  Probably not.
+
address@hidden
+Should the @code{ext_id}, which is currently just a null pointer,
+be made to point to something?  What would be carry around in it?
address@hidden enumerate
+
address@hidden Additional @command{gawk} built-ins
+Based on some discussion with Andrew Schorr, I'd like to find a way
+to change the additional @command{gawk} built-in functions, like
address@hidden()}, @code{strftime()}, etc. into ``pre-defined''
+extension functions in the @samp{awk} namespace.  This has some
+advantages:
+
address@hidden 1
address@hidden
+It gives us room to add more built-ins without their being reserved
+words to the grammar.  This in turn means that:
+
address@hidden
+Users can define their own functions with the same name as @command{gawk}
+additions as long as they put them in their own namespace.
address@hidden enumerate
+
+Everybody wins!
+
+Note that POSIX-standard pre-defined @command{awk} names such as 
@command{length()}
+and @command{sub()} would remain reserved. The following would produce
+a syntax error:
+
address@hidden
+@@namespace "example"
+
+function gsub(str, pat, result) @{ @dots{} @}
address@hidden example
+
address@hidden
+Whereas this would not:
+
address@hidden
+@@namespace "example"
+
+function gensub(str, pat, result) @{ @dots{} @}
address@hidden example
+
 @end table
 
 @node Arbitrary Precision Arithmetic

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

Summary of changes:
 doc/ChangeLog   |   4 +
 doc/gawk.info   | 655 ++++++++++++++++++++++++++++++--------------------------
 doc/gawk.texi   |  78 ++++++-
 doc/gawktexi.in |  78 ++++++-
 4 files changed, 513 insertions(+), 302 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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