diff options
-rw-r--r-- | doc/ChangeLog | 5 | ||||
-rw-r--r-- | doc/gawk.info | 632 | ||||
-rw-r--r-- | doc/gawk.texi | 19 | ||||
-rw-r--r-- | doc/gawktexi.in | 19 |
4 files changed, 351 insertions, 324 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index 4cdf8377..73421635 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,10 @@ 2017-07-28 Arnold D. Robbins <arnold@skeeve.com> + * gawktexi.in (Type Functions): Improve the example + for untyped variables. + +2017-07-28 Arnold D. Robbins <arnold@skeeve.com> + * gawktexi.in (Extension Sample Inplace): Apply GPL to inplace.awk; should have done that when it was first added. Oops. diff --git a/doc/gawk.info b/doc/gawk.info index 66ba25c4..41b10fda 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -13976,15 +13976,23 @@ contexts. '"untyped"' X has not yet been used yet at all; it can become a scalar or - an array. For example: + an array. The typing could even conceivably differ from run + to run of the same program! For example: BEGIN { - print typeof(x) # x never used --> untyped - mk_arr(x) - print typeof(x) # x now an array --> array + print "initially, typeof(v) = ", typeof(v) + + if ("FOO" in ENVIRON) + make_scalar(v) + else + make_array(v) + + print "typeof(v) =", typeof(v) } - function mk_arr(a) { a[1] = 1 } + function make_scalar(p, l) { l = p } + + function make_array(p) { p[1] = 1 } 'isarray()' is meant for use in two circumstances. The first is when traversing a multidimensional array: you can test if an element is @@ -36018,312 +36026,312 @@ Ref: table-bitwise-ops583993 Ref: Bitwise Functions-Footnote-1590026 Ref: Bitwise Functions-Footnote-2590199 Node: Type Functions590390 -Node: I18N Functions593065 -Node: User-defined594716 -Node: Definition Syntax595521 -Ref: Definition Syntax-Footnote-1601208 -Node: Function Example601279 -Ref: Function Example-Footnote-1604201 -Node: Function Caveats604223 -Node: Calling A Function604741 -Node: Variable Scope605699 -Node: Pass By Value/Reference608693 -Node: Return Statement612192 -Node: Dynamic Typing615171 -Node: Indirect Calls616101 -Ref: Indirect Calls-Footnote-1626352 -Node: Functions Summary626480 -Node: Library Functions629185 -Ref: Library Functions-Footnote-1632792 -Ref: Library Functions-Footnote-2632935 -Node: Library Names633106 -Ref: Library Names-Footnote-1636566 -Ref: Library Names-Footnote-2636789 -Node: General Functions636875 -Node: Strtonum Function637978 -Node: Assert Function641000 -Node: Round Function644326 -Node: Cliff Random Function645867 -Node: Ordinal Functions646883 -Ref: Ordinal Functions-Footnote-1649946 -Ref: Ordinal Functions-Footnote-2650198 -Node: Join Function650408 -Ref: Join Function-Footnote-1652178 -Node: Getlocaltime Function652378 -Node: Readfile Function656120 -Node: Shell Quoting658092 -Node: Data File Management659493 -Node: Filetrans Function660125 -Node: Rewind Function664221 -Node: File Checking666131 -Ref: File Checking-Footnote-1667465 -Node: Empty Files667666 -Node: Ignoring Assigns669645 -Node: Getopt Function671195 -Ref: Getopt Function-Footnote-1682664 -Node: Passwd Functions682864 -Ref: Passwd Functions-Footnote-1691703 -Node: Group Functions691791 -Ref: Group Functions-Footnote-1699689 -Node: Walking Arrays699896 -Node: Library Functions Summary702904 -Node: Library Exercises704310 -Node: Sample Programs704775 -Node: Running Examples705545 -Node: Clones706273 -Node: Cut Program707497 -Node: Egrep Program717426 -Ref: Egrep Program-Footnote-1724938 -Node: Id Program725048 -Node: Split Program728728 -Ref: Split Program-Footnote-1732187 -Node: Tee Program732316 -Node: Uniq Program735106 -Node: Wc Program742532 -Ref: Wc Program-Footnote-1746787 -Node: Miscellaneous Programs746881 -Node: Dupword Program748094 -Node: Alarm Program750124 -Node: Translate Program754979 -Ref: Translate Program-Footnote-1759544 -Node: Labels Program759814 -Ref: Labels Program-Footnote-1763165 -Node: Word Sorting763249 -Node: History Sorting767321 -Node: Extract Program769156 -Node: Simple Sed776685 -Node: Igawk Program779759 -Ref: Igawk Program-Footnote-1794090 -Ref: Igawk Program-Footnote-2794292 -Ref: Igawk Program-Footnote-3794414 -Node: Anagram Program794529 -Node: Signature Program797591 -Node: Programs Summary798838 -Node: Programs Exercises800052 -Ref: Programs Exercises-Footnote-1804181 -Node: Advanced Features804272 -Node: Nondecimal Data806262 -Node: Array Sorting807853 -Node: Controlling Array Traversal808553 -Ref: Controlling Array Traversal-Footnote-1816920 -Node: Array Sorting Functions817038 -Ref: Array Sorting Functions-Footnote-1822129 -Node: Two-way I/O822325 -Ref: Two-way I/O-Footnote-1828876 -Ref: Two-way I/O-Footnote-2829063 -Node: TCP/IP Networking829145 -Node: Profiling832263 -Ref: Profiling-Footnote-1840935 -Node: Advanced Features Summary841258 -Node: Internationalization843102 -Node: I18N and L10N844582 -Node: Explaining gettext845269 -Ref: Explaining gettext-Footnote-1851161 -Ref: Explaining gettext-Footnote-2851346 -Node: Programmer i18n851511 -Ref: Programmer i18n-Footnote-1856460 -Node: Translator i18n856509 -Node: String Extraction857303 -Ref: String Extraction-Footnote-1858435 -Node: Printf Ordering858521 -Ref: Printf Ordering-Footnote-1861307 -Node: I18N Portability861371 -Ref: I18N Portability-Footnote-1863827 -Node: I18N Example863890 -Ref: I18N Example-Footnote-1866696 -Node: Gawk I18N866769 -Node: I18N Summary867414 -Node: Debugger868755 -Node: Debugging869777 -Node: Debugging Concepts870218 -Node: Debugging Terms872027 -Node: Awk Debugging874602 -Node: Sample Debugging Session875508 -Node: Debugger Invocation876042 -Node: Finding The Bug877428 -Node: List of Debugger Commands883906 -Node: Breakpoint Control885239 -Node: Debugger Execution Control888933 -Node: Viewing And Changing Data892295 -Node: Execution Stack895669 -Node: Debugger Info897306 -Node: Miscellaneous Debugger Commands901377 -Node: Readline Support906465 -Node: Limitations907361 -Node: Debugging Summary909470 -Node: Arbitrary Precision Arithmetic910749 -Node: Computer Arithmetic912234 -Ref: table-numeric-ranges915825 -Ref: Computer Arithmetic-Footnote-1916547 -Node: Math Definitions916604 -Ref: table-ieee-formats919918 -Ref: Math Definitions-Footnote-1920521 -Node: MPFR features920626 -Node: FP Math Caution922343 -Ref: FP Math Caution-Footnote-1923415 -Node: Inexactness of computations923784 -Node: Inexact representation924744 -Node: Comparing FP Values926104 -Node: Errors accumulate927186 -Node: Getting Accuracy928619 -Node: Try To Round931329 -Node: Setting precision932228 -Ref: table-predefined-precision-strings932925 -Node: Setting the rounding mode934755 -Ref: table-gawk-rounding-modes935129 -Ref: Setting the rounding mode-Footnote-1938537 -Node: Arbitrary Precision Integers938716 -Ref: Arbitrary Precision Integers-Footnote-1943621 -Node: Checking for MPFR943770 -Node: POSIX Floating Point Problems945067 -Ref: POSIX Floating Point Problems-Footnote-1948938 -Node: Floating point summary948976 -Node: Dynamic Extensions951166 -Node: Extension Intro952719 -Node: Plugin License953985 -Node: Extension Mechanism Outline954782 -Ref: figure-load-extension955221 -Ref: figure-register-new-function956786 -Ref: figure-call-new-function957878 -Node: Extension API Description959940 -Node: Extension API Functions Introduction961582 -Node: General Data Types966916 -Ref: General Data Types-Footnote-1974121 -Node: Memory Allocation Functions974420 -Ref: Memory Allocation Functions-Footnote-1977572 -Node: Constructor Functions977671 -Node: Registration Functions980670 -Node: Extension Functions981355 -Node: Exit Callback Functions986568 -Node: Extension Version String987818 -Node: Input Parsers988481 -Node: Output Wrappers1001188 -Node: Two-way processors1005700 -Node: Printing Messages1007965 -Ref: Printing Messages-Footnote-11009136 -Node: Updating ERRNO1009289 -Node: Requesting Values1010028 -Ref: table-value-types-returned1010765 -Node: Accessing Parameters1011701 -Node: Symbol Table Access1012936 -Node: Symbol table by name1013448 -Node: Symbol table by cookie1015237 -Ref: Symbol table by cookie-Footnote-11019422 -Node: Cached values1019486 -Ref: Cached values-Footnote-11023022 -Node: Array Manipulation1023113 -Ref: Array Manipulation-Footnote-11024204 -Node: Array Data Types1024241 -Ref: Array Data Types-Footnote-11026899 -Node: Array Functions1026991 -Node: Flattening Arrays1031390 -Node: Creating Arrays1038331 -Node: Redirection API1043100 -Node: Extension API Variables1045942 -Node: Extension Versioning1046575 -Ref: gawk-api-version1047012 -Node: Extension API Informational Variables1048740 -Node: Extension API Boilerplate1049804 -Node: Changes from API V11053666 -Node: Finding Extensions1054326 -Node: Extension Example1054885 -Node: Internal File Description1055683 -Node: Internal File Ops1059763 -Ref: Internal File Ops-Footnote-11071163 -Node: Using Internal File Ops1071303 -Ref: Using Internal File Ops-Footnote-11073686 -Node: Extension Samples1073960 -Node: Extension Sample File Functions1075489 -Node: Extension Sample Fnmatch1083138 -Node: Extension Sample Fork1084625 -Node: Extension Sample Inplace1085843 -Node: Extension Sample Ord1089060 -Node: Extension Sample Readdir1089896 -Ref: table-readdir-file-types1090785 -Node: Extension Sample Revout1091590 -Node: Extension Sample Rev2way1092179 -Node: Extension Sample Read write array1092919 -Node: Extension Sample Readfile1094861 -Node: Extension Sample Time1095956 -Node: Extension Sample API Tests1097304 -Node: gawkextlib1097796 -Node: Extension summary1100243 -Node: Extension Exercises1103945 -Node: Language History1105443 -Node: V7/SVR3.11107099 -Node: SVR41109251 -Node: POSIX1110685 -Node: BTL1112064 -Node: POSIX/GNU1112793 -Node: Feature History1118685 -Node: Common Extensions1133109 -Node: Ranges and Locales1134392 -Ref: Ranges and Locales-Footnote-11139008 -Ref: Ranges and Locales-Footnote-21139035 -Ref: Ranges and Locales-Footnote-31139270 -Node: Contributors1139491 -Node: History summary1145051 -Node: Installation1146431 -Node: Gawk Distribution1147375 -Node: Getting1147859 -Node: Extracting1148820 -Node: Distribution contents1150458 -Node: Unix Installation1156800 -Node: Quick Installation1157482 -Node: Shell Startup Files1159896 -Node: Additional Configuration Options1160985 -Node: Configuration Philosophy1162974 -Node: Non-Unix Installation1165343 -Node: PC Installation1165803 -Node: PC Binary Installation1166641 -Node: PC Compiling1167076 -Node: PC Using1168193 -Node: Cygwin1171238 -Node: MSYS1172008 -Node: VMS Installation1172509 -Node: VMS Compilation1173300 -Ref: VMS Compilation-Footnote-11174529 -Node: VMS Dynamic Extensions1174587 -Node: VMS Installation Details1176272 -Node: VMS Running1178525 -Node: VMS GNV1182804 -Node: VMS Old Gawk1183539 -Node: Bugs1184010 -Node: Bug address1184673 -Node: Usenet1187070 -Node: Maintainers1187847 -Node: Other Versions1189223 -Node: Installation summary1195807 -Node: Notes1196842 -Node: Compatibility Mode1197707 -Node: Additions1198489 -Node: Accessing The Source1199414 -Node: Adding Code1200849 -Node: New Ports1207067 -Node: Derived Files1211555 -Ref: Derived Files-Footnote-11217040 -Ref: Derived Files-Footnote-21217075 -Ref: Derived Files-Footnote-31217673 -Node: Future Extensions1217787 -Node: Implementation Limitations1218445 -Node: Extension Design1219628 -Node: Old Extension Problems1220782 -Ref: Old Extension Problems-Footnote-11222300 -Node: Extension New Mechanism Goals1222357 -Ref: Extension New Mechanism Goals-Footnote-11225721 -Node: Extension Other Design Decisions1225910 -Node: Extension Future Growth1228023 -Node: Old Extension Mechanism1228859 -Node: Notes summary1230622 -Node: Basic Concepts1231804 -Node: Basic High Level1232485 -Ref: figure-general-flow1232767 -Ref: figure-process-flow1233452 -Ref: Basic High Level-Footnote-11236753 -Node: Basic Data Typing1236938 -Node: Glossary1240266 -Node: Copying1272213 -Node: GNU Free Documentation License1309752 -Node: Index1334870 +Node: I18N Functions593307 +Node: User-defined594958 +Node: Definition Syntax595763 +Ref: Definition Syntax-Footnote-1601450 +Node: Function Example601521 +Ref: Function Example-Footnote-1604443 +Node: Function Caveats604465 +Node: Calling A Function604983 +Node: Variable Scope605941 +Node: Pass By Value/Reference608935 +Node: Return Statement612434 +Node: Dynamic Typing615413 +Node: Indirect Calls616343 +Ref: Indirect Calls-Footnote-1626594 +Node: Functions Summary626722 +Node: Library Functions629427 +Ref: Library Functions-Footnote-1633034 +Ref: Library Functions-Footnote-2633177 +Node: Library Names633348 +Ref: Library Names-Footnote-1636808 +Ref: Library Names-Footnote-2637031 +Node: General Functions637117 +Node: Strtonum Function638220 +Node: Assert Function641242 +Node: Round Function644568 +Node: Cliff Random Function646109 +Node: Ordinal Functions647125 +Ref: Ordinal Functions-Footnote-1650188 +Ref: Ordinal Functions-Footnote-2650440 +Node: Join Function650650 +Ref: Join Function-Footnote-1652420 +Node: Getlocaltime Function652620 +Node: Readfile Function656362 +Node: Shell Quoting658334 +Node: Data File Management659735 +Node: Filetrans Function660367 +Node: Rewind Function664463 +Node: File Checking666373 +Ref: File Checking-Footnote-1667707 +Node: Empty Files667908 +Node: Ignoring Assigns669887 +Node: Getopt Function671437 +Ref: Getopt Function-Footnote-1682906 +Node: Passwd Functions683106 +Ref: Passwd Functions-Footnote-1691945 +Node: Group Functions692033 +Ref: Group Functions-Footnote-1699931 +Node: Walking Arrays700138 +Node: Library Functions Summary703146 +Node: Library Exercises704552 +Node: Sample Programs705017 +Node: Running Examples705787 +Node: Clones706515 +Node: Cut Program707739 +Node: Egrep Program717668 +Ref: Egrep Program-Footnote-1725180 +Node: Id Program725290 +Node: Split Program728970 +Ref: Split Program-Footnote-1732429 +Node: Tee Program732558 +Node: Uniq Program735348 +Node: Wc Program742774 +Ref: Wc Program-Footnote-1747029 +Node: Miscellaneous Programs747123 +Node: Dupword Program748336 +Node: Alarm Program750366 +Node: Translate Program755221 +Ref: Translate Program-Footnote-1759786 +Node: Labels Program760056 +Ref: Labels Program-Footnote-1763407 +Node: Word Sorting763491 +Node: History Sorting767563 +Node: Extract Program769398 +Node: Simple Sed776927 +Node: Igawk Program780001 +Ref: Igawk Program-Footnote-1794332 +Ref: Igawk Program-Footnote-2794534 +Ref: Igawk Program-Footnote-3794656 +Node: Anagram Program794771 +Node: Signature Program797833 +Node: Programs Summary799080 +Node: Programs Exercises800294 +Ref: Programs Exercises-Footnote-1804423 +Node: Advanced Features804514 +Node: Nondecimal Data806504 +Node: Array Sorting808095 +Node: Controlling Array Traversal808795 +Ref: Controlling Array Traversal-Footnote-1817162 +Node: Array Sorting Functions817280 +Ref: Array Sorting Functions-Footnote-1822371 +Node: Two-way I/O822567 +Ref: Two-way I/O-Footnote-1829118 +Ref: Two-way I/O-Footnote-2829305 +Node: TCP/IP Networking829387 +Node: Profiling832505 +Ref: Profiling-Footnote-1841177 +Node: Advanced Features Summary841500 +Node: Internationalization843344 +Node: I18N and L10N844824 +Node: Explaining gettext845511 +Ref: Explaining gettext-Footnote-1851403 +Ref: Explaining gettext-Footnote-2851588 +Node: Programmer i18n851753 +Ref: Programmer i18n-Footnote-1856702 +Node: Translator i18n856751 +Node: String Extraction857545 +Ref: String Extraction-Footnote-1858677 +Node: Printf Ordering858763 +Ref: Printf Ordering-Footnote-1861549 +Node: I18N Portability861613 +Ref: I18N Portability-Footnote-1864069 +Node: I18N Example864132 +Ref: I18N Example-Footnote-1866938 +Node: Gawk I18N867011 +Node: I18N Summary867656 +Node: Debugger868997 +Node: Debugging870019 +Node: Debugging Concepts870460 +Node: Debugging Terms872269 +Node: Awk Debugging874844 +Node: Sample Debugging Session875750 +Node: Debugger Invocation876284 +Node: Finding The Bug877670 +Node: List of Debugger Commands884148 +Node: Breakpoint Control885481 +Node: Debugger Execution Control889175 +Node: Viewing And Changing Data892537 +Node: Execution Stack895911 +Node: Debugger Info897548 +Node: Miscellaneous Debugger Commands901619 +Node: Readline Support906707 +Node: Limitations907603 +Node: Debugging Summary909712 +Node: Arbitrary Precision Arithmetic910991 +Node: Computer Arithmetic912476 +Ref: table-numeric-ranges916067 +Ref: Computer Arithmetic-Footnote-1916789 +Node: Math Definitions916846 +Ref: table-ieee-formats920160 +Ref: Math Definitions-Footnote-1920763 +Node: MPFR features920868 +Node: FP Math Caution922585 +Ref: FP Math Caution-Footnote-1923657 +Node: Inexactness of computations924026 +Node: Inexact representation924986 +Node: Comparing FP Values926346 +Node: Errors accumulate927428 +Node: Getting Accuracy928861 +Node: Try To Round931571 +Node: Setting precision932470 +Ref: table-predefined-precision-strings933167 +Node: Setting the rounding mode934997 +Ref: table-gawk-rounding-modes935371 +Ref: Setting the rounding mode-Footnote-1938779 +Node: Arbitrary Precision Integers938958 +Ref: Arbitrary Precision Integers-Footnote-1943863 +Node: Checking for MPFR944012 +Node: POSIX Floating Point Problems945309 +Ref: POSIX Floating Point Problems-Footnote-1949180 +Node: Floating point summary949218 +Node: Dynamic Extensions951408 +Node: Extension Intro952961 +Node: Plugin License954227 +Node: Extension Mechanism Outline955024 +Ref: figure-load-extension955463 +Ref: figure-register-new-function957028 +Ref: figure-call-new-function958120 +Node: Extension API Description960182 +Node: Extension API Functions Introduction961824 +Node: General Data Types967158 +Ref: General Data Types-Footnote-1974363 +Node: Memory Allocation Functions974662 +Ref: Memory Allocation Functions-Footnote-1977814 +Node: Constructor Functions977913 +Node: Registration Functions980912 +Node: Extension Functions981597 +Node: Exit Callback Functions986810 +Node: Extension Version String988060 +Node: Input Parsers988723 +Node: Output Wrappers1001430 +Node: Two-way processors1005942 +Node: Printing Messages1008207 +Ref: Printing Messages-Footnote-11009378 +Node: Updating ERRNO1009531 +Node: Requesting Values1010270 +Ref: table-value-types-returned1011007 +Node: Accessing Parameters1011943 +Node: Symbol Table Access1013178 +Node: Symbol table by name1013690 +Node: Symbol table by cookie1015479 +Ref: Symbol table by cookie-Footnote-11019664 +Node: Cached values1019728 +Ref: Cached values-Footnote-11023264 +Node: Array Manipulation1023355 +Ref: Array Manipulation-Footnote-11024446 +Node: Array Data Types1024483 +Ref: Array Data Types-Footnote-11027141 +Node: Array Functions1027233 +Node: Flattening Arrays1031632 +Node: Creating Arrays1038573 +Node: Redirection API1043342 +Node: Extension API Variables1046184 +Node: Extension Versioning1046817 +Ref: gawk-api-version1047254 +Node: Extension API Informational Variables1048982 +Node: Extension API Boilerplate1050046 +Node: Changes from API V11053908 +Node: Finding Extensions1054568 +Node: Extension Example1055127 +Node: Internal File Description1055925 +Node: Internal File Ops1060005 +Ref: Internal File Ops-Footnote-11071405 +Node: Using Internal File Ops1071545 +Ref: Using Internal File Ops-Footnote-11073928 +Node: Extension Samples1074202 +Node: Extension Sample File Functions1075731 +Node: Extension Sample Fnmatch1083380 +Node: Extension Sample Fork1084867 +Node: Extension Sample Inplace1086085 +Node: Extension Sample Ord1089302 +Node: Extension Sample Readdir1090138 +Ref: table-readdir-file-types1091027 +Node: Extension Sample Revout1091832 +Node: Extension Sample Rev2way1092421 +Node: Extension Sample Read write array1093161 +Node: Extension Sample Readfile1095103 +Node: Extension Sample Time1096198 +Node: Extension Sample API Tests1097546 +Node: gawkextlib1098038 +Node: Extension summary1100485 +Node: Extension Exercises1104187 +Node: Language History1105685 +Node: V7/SVR3.11107341 +Node: SVR41109493 +Node: POSIX1110927 +Node: BTL1112306 +Node: POSIX/GNU1113035 +Node: Feature History1118927 +Node: Common Extensions1133351 +Node: Ranges and Locales1134634 +Ref: Ranges and Locales-Footnote-11139250 +Ref: Ranges and Locales-Footnote-21139277 +Ref: Ranges and Locales-Footnote-31139512 +Node: Contributors1139733 +Node: History summary1145293 +Node: Installation1146673 +Node: Gawk Distribution1147617 +Node: Getting1148101 +Node: Extracting1149062 +Node: Distribution contents1150700 +Node: Unix Installation1157042 +Node: Quick Installation1157724 +Node: Shell Startup Files1160138 +Node: Additional Configuration Options1161227 +Node: Configuration Philosophy1163216 +Node: Non-Unix Installation1165585 +Node: PC Installation1166045 +Node: PC Binary Installation1166883 +Node: PC Compiling1167318 +Node: PC Using1168435 +Node: Cygwin1171480 +Node: MSYS1172250 +Node: VMS Installation1172751 +Node: VMS Compilation1173542 +Ref: VMS Compilation-Footnote-11174771 +Node: VMS Dynamic Extensions1174829 +Node: VMS Installation Details1176514 +Node: VMS Running1178767 +Node: VMS GNV1183046 +Node: VMS Old Gawk1183781 +Node: Bugs1184252 +Node: Bug address1184915 +Node: Usenet1187312 +Node: Maintainers1188089 +Node: Other Versions1189465 +Node: Installation summary1196049 +Node: Notes1197084 +Node: Compatibility Mode1197949 +Node: Additions1198731 +Node: Accessing The Source1199656 +Node: Adding Code1201091 +Node: New Ports1207309 +Node: Derived Files1211797 +Ref: Derived Files-Footnote-11217282 +Ref: Derived Files-Footnote-21217317 +Ref: Derived Files-Footnote-31217915 +Node: Future Extensions1218029 +Node: Implementation Limitations1218687 +Node: Extension Design1219870 +Node: Old Extension Problems1221024 +Ref: Old Extension Problems-Footnote-11222542 +Node: Extension New Mechanism Goals1222599 +Ref: Extension New Mechanism Goals-Footnote-11225963 +Node: Extension Other Design Decisions1226152 +Node: Extension Future Growth1228265 +Node: Old Extension Mechanism1229101 +Node: Notes summary1230864 +Node: Basic Concepts1232046 +Node: Basic High Level1232727 +Ref: figure-general-flow1233009 +Ref: figure-process-flow1233694 +Ref: Basic High Level-Footnote-11236995 +Node: Basic Data Typing1237180 +Node: Glossary1240508 +Node: Copying1272455 +Node: GNU Free Documentation License1309994 +Node: Index1335112 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index b75c2d00..66312691 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -20042,17 +20042,24 @@ BEGIN @{ @item "untyped" @var{x} has not yet been used yet at all; it can become a scalar or an -array. -For example: +array. The typing could even conceivably differ from run to run of +the same program! For example: @example BEGIN @{ - print typeof(x) # x never used --> untyped - mk_arr(x) - print typeof(x) # x now an array --> array + print "initially, typeof(v) = ", typeof(v) + + if ("FOO" in ENVIRON) + make_scalar(v) + else + make_array(v) + + print "typeof(v) =", typeof(v) @} -function mk_arr(a) @{ a[1] = 1 @} +function make_scalar(p, l) @{ l = p @} + +function make_array(p) @{ p[1] = 1 @} @end example @end table diff --git a/doc/gawktexi.in b/doc/gawktexi.in index d13ea969..f7d396bf 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -19086,17 +19086,24 @@ BEGIN @{ @item "untyped" @var{x} has not yet been used yet at all; it can become a scalar or an -array. -For example: +array. The typing could even conceivably differ from run to run of +the same program! For example: @example BEGIN @{ - print typeof(x) # x never used --> untyped - mk_arr(x) - print typeof(x) # x now an array --> array + print "initially, typeof(v) = ", typeof(v) + + if ("FOO" in ENVIRON) + make_scalar(v) + else + make_array(v) + + print "typeof(v) =", typeof(v) @} -function mk_arr(a) @{ a[1] = 1 @} +function make_scalar(p, l) @{ l = p @} + +function make_array(p) @{ p[1] = 1 @} @end example @end table |