diff options
Diffstat (limited to 'doc/gawk.info')
-rw-r--r-- | doc/gawk.info | 632 |
1 files changed, 320 insertions, 312 deletions
diff --git a/doc/gawk.info b/doc/gawk.info index 0ff0fdfd..6a339595 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -13958,15 +13958,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 @@ -35941,312 +35949,312 @@ Ref: table-bitwise-ops583076 Ref: Bitwise Functions-Footnote-1589109 Ref: Bitwise Functions-Footnote-2589282 Node: Type Functions589473 -Node: I18N Functions592148 -Node: User-defined593799 -Node: Definition Syntax594604 -Ref: Definition Syntax-Footnote-1600291 -Node: Function Example600362 -Ref: Function Example-Footnote-1603284 -Node: Function Caveats603306 -Node: Calling A Function603824 -Node: Variable Scope604782 -Node: Pass By Value/Reference607776 -Node: Return Statement611275 -Node: Dynamic Typing614254 -Node: Indirect Calls615184 -Ref: Indirect Calls-Footnote-1625435 -Node: Functions Summary625563 -Node: Library Functions628268 -Ref: Library Functions-Footnote-1631875 -Ref: Library Functions-Footnote-2632018 -Node: Library Names632189 -Ref: Library Names-Footnote-1635649 -Ref: Library Names-Footnote-2635872 -Node: General Functions635958 -Node: Strtonum Function637061 -Node: Assert Function640083 -Node: Round Function643409 -Node: Cliff Random Function644950 -Node: Ordinal Functions645966 -Ref: Ordinal Functions-Footnote-1649029 -Ref: Ordinal Functions-Footnote-2649281 -Node: Join Function649491 -Ref: Join Function-Footnote-1651261 -Node: Getlocaltime Function651461 -Node: Readfile Function655203 -Node: Shell Quoting657175 -Node: Data File Management658576 -Node: Filetrans Function659208 -Node: Rewind Function663304 -Node: File Checking665214 -Ref: File Checking-Footnote-1666548 -Node: Empty Files666749 -Node: Ignoring Assigns668728 -Node: Getopt Function670278 -Ref: Getopt Function-Footnote-1681747 -Node: Passwd Functions681947 -Ref: Passwd Functions-Footnote-1690786 -Node: Group Functions690874 -Ref: Group Functions-Footnote-1698772 -Node: Walking Arrays698979 -Node: Library Functions Summary701987 -Node: Library Exercises703393 -Node: Sample Programs703858 -Node: Running Examples704628 -Node: Clones705356 -Node: Cut Program706580 -Node: Egrep Program716509 -Ref: Egrep Program-Footnote-1724021 -Node: Id Program724131 -Node: Split Program727811 -Ref: Split Program-Footnote-1731270 -Node: Tee Program731399 -Node: Uniq Program734189 -Node: Wc Program741615 -Ref: Wc Program-Footnote-1745870 -Node: Miscellaneous Programs745964 -Node: Dupword Program747177 -Node: Alarm Program749207 -Node: Translate Program754062 -Ref: Translate Program-Footnote-1758627 -Node: Labels Program758897 -Ref: Labels Program-Footnote-1762248 -Node: Word Sorting762332 -Node: History Sorting766404 -Node: Extract Program768239 -Node: Simple Sed775768 -Node: Igawk Program778842 -Ref: Igawk Program-Footnote-1793173 -Ref: Igawk Program-Footnote-2793375 -Ref: Igawk Program-Footnote-3793497 -Node: Anagram Program793612 -Node: Signature Program796674 -Node: Programs Summary797921 -Node: Programs Exercises799135 -Ref: Programs Exercises-Footnote-1803264 -Node: Advanced Features803355 -Node: Nondecimal Data805345 -Node: Array Sorting806936 -Node: Controlling Array Traversal807636 -Ref: Controlling Array Traversal-Footnote-1816003 -Node: Array Sorting Functions816121 -Ref: Array Sorting Functions-Footnote-1821212 -Node: Two-way I/O821408 -Ref: Two-way I/O-Footnote-1827959 -Ref: Two-way I/O-Footnote-2828146 -Node: TCP/IP Networking828228 -Node: Profiling831346 -Ref: Profiling-Footnote-1840018 -Node: Advanced Features Summary840341 -Node: Internationalization842185 -Node: I18N and L10N843665 -Node: Explaining gettext844352 -Ref: Explaining gettext-Footnote-1850244 -Ref: Explaining gettext-Footnote-2850429 -Node: Programmer i18n850594 -Ref: Programmer i18n-Footnote-1855543 -Node: Translator i18n855592 -Node: String Extraction856386 -Ref: String Extraction-Footnote-1857518 -Node: Printf Ordering857604 -Ref: Printf Ordering-Footnote-1860390 -Node: I18N Portability860454 -Ref: I18N Portability-Footnote-1862910 -Node: I18N Example862973 -Ref: I18N Example-Footnote-1865779 -Node: Gawk I18N865852 -Node: I18N Summary866497 -Node: Debugger867838 -Node: Debugging868860 -Node: Debugging Concepts869301 -Node: Debugging Terms871110 -Node: Awk Debugging873685 -Node: Sample Debugging Session874591 -Node: Debugger Invocation875125 -Node: Finding The Bug876511 -Node: List of Debugger Commands882989 -Node: Breakpoint Control884322 -Node: Debugger Execution Control888016 -Node: Viewing And Changing Data891378 -Node: Execution Stack894752 -Node: Debugger Info896389 -Node: Miscellaneous Debugger Commands900460 -Node: Readline Support905548 -Node: Limitations906444 -Node: Debugging Summary908553 -Node: Arbitrary Precision Arithmetic909832 -Node: Computer Arithmetic911317 -Ref: table-numeric-ranges914908 -Ref: Computer Arithmetic-Footnote-1915630 -Node: Math Definitions915687 -Ref: table-ieee-formats919001 -Ref: Math Definitions-Footnote-1919604 -Node: MPFR features919709 -Node: FP Math Caution921426 -Ref: FP Math Caution-Footnote-1922498 -Node: Inexactness of computations922867 -Node: Inexact representation923827 -Node: Comparing FP Values925187 -Node: Errors accumulate926269 -Node: Getting Accuracy927702 -Node: Try To Round930412 -Node: Setting precision931311 -Ref: table-predefined-precision-strings932008 -Node: Setting the rounding mode933838 -Ref: table-gawk-rounding-modes934212 -Ref: Setting the rounding mode-Footnote-1937620 -Node: Arbitrary Precision Integers937799 -Ref: Arbitrary Precision Integers-Footnote-1940974 -Node: Checking for MPFR941123 -Node: POSIX Floating Point Problems942420 -Ref: POSIX Floating Point Problems-Footnote-1946291 -Node: Floating point summary946329 -Node: Dynamic Extensions948519 -Node: Extension Intro950072 -Node: Plugin License951338 -Node: Extension Mechanism Outline952135 -Ref: figure-load-extension952574 -Ref: figure-register-new-function954139 -Ref: figure-call-new-function955231 -Node: Extension API Description957293 -Node: Extension API Functions Introduction958935 -Node: General Data Types964269 -Ref: General Data Types-Footnote-1971474 -Node: Memory Allocation Functions971773 -Ref: Memory Allocation Functions-Footnote-1974925 -Node: Constructor Functions975024 -Node: Registration Functions978023 -Node: Extension Functions978708 -Node: Exit Callback Functions983921 -Node: Extension Version String985171 -Node: Input Parsers985834 -Node: Output Wrappers998541 -Node: Two-way processors1003053 -Node: Printing Messages1005318 -Ref: Printing Messages-Footnote-11006489 -Node: Updating ERRNO1006642 -Node: Requesting Values1007381 -Ref: table-value-types-returned1008118 -Node: Accessing Parameters1009054 -Node: Symbol Table Access1010289 -Node: Symbol table by name1010801 -Node: Symbol table by cookie1012590 -Ref: Symbol table by cookie-Footnote-11016775 -Node: Cached values1016839 -Ref: Cached values-Footnote-11020375 -Node: Array Manipulation1020466 -Ref: Array Manipulation-Footnote-11021557 -Node: Array Data Types1021594 -Ref: Array Data Types-Footnote-11024252 -Node: Array Functions1024344 -Node: Flattening Arrays1028743 -Node: Creating Arrays1035684 -Node: Redirection API1040453 -Node: Extension API Variables1043295 -Node: Extension Versioning1043928 -Ref: gawk-api-version1044365 -Node: Extension API Informational Variables1046093 -Node: Extension API Boilerplate1047157 -Node: Changes from API V11051019 -Node: Finding Extensions1051679 -Node: Extension Example1052238 -Node: Internal File Description1053036 -Node: Internal File Ops1057116 -Ref: Internal File Ops-Footnote-11068516 -Node: Using Internal File Ops1068656 -Ref: Using Internal File Ops-Footnote-11071039 -Node: Extension Samples1071313 -Node: Extension Sample File Functions1072842 -Node: Extension Sample Fnmatch1080491 -Node: Extension Sample Fork1081978 -Node: Extension Sample Inplace1083196 -Node: Extension Sample Ord1086413 -Node: Extension Sample Readdir1087249 -Ref: table-readdir-file-types1088138 -Node: Extension Sample Revout1088943 -Node: Extension Sample Rev2way1089532 -Node: Extension Sample Read write array1090272 -Node: Extension Sample Readfile1092214 -Node: Extension Sample Time1093309 -Node: Extension Sample API Tests1094657 -Node: gawkextlib1095149 -Node: Extension summary1097596 -Node: Extension Exercises1101298 -Node: Language History1102796 -Node: V7/SVR3.11104452 -Node: SVR41106604 -Node: POSIX1108038 -Node: BTL1109417 -Node: POSIX/GNU1110146 -Node: Feature History1115924 -Node: Common Extensions1130289 -Node: Ranges and Locales1131572 -Ref: Ranges and Locales-Footnote-11136188 -Ref: Ranges and Locales-Footnote-21136215 -Ref: Ranges and Locales-Footnote-31136450 -Node: Contributors1136671 -Node: History summary1142231 -Node: Installation1143611 -Node: Gawk Distribution1144555 -Node: Getting1145039 -Node: Extracting1146000 -Node: Distribution contents1147638 -Node: Unix Installation1153980 -Node: Quick Installation1154662 -Node: Shell Startup Files1157076 -Node: Additional Configuration Options1158165 -Node: Configuration Philosophy1160154 -Node: Non-Unix Installation1162523 -Node: PC Installation1162983 -Node: PC Binary Installation1163821 -Node: PC Compiling1164256 -Node: PC Using1165373 -Node: Cygwin1168418 -Node: MSYS1169188 -Node: VMS Installation1169689 -Node: VMS Compilation1170480 -Ref: VMS Compilation-Footnote-11171709 -Node: VMS Dynamic Extensions1171767 -Node: VMS Installation Details1173452 -Node: VMS Running1175705 -Node: VMS GNV1179984 -Node: VMS Old Gawk1180719 -Node: Bugs1181190 -Node: Bug address1181853 -Node: Usenet1184250 -Node: Maintainers1185027 -Node: Other Versions1186403 -Node: Installation summary1192987 -Node: Notes1194022 -Node: Compatibility Mode1194887 -Node: Additions1195669 -Node: Accessing The Source1196594 -Node: Adding Code1198029 -Node: New Ports1204247 -Node: Derived Files1208735 -Ref: Derived Files-Footnote-11214220 -Ref: Derived Files-Footnote-21214255 -Ref: Derived Files-Footnote-31214853 -Node: Future Extensions1214967 -Node: Implementation Limitations1215625 -Node: Extension Design1216808 -Node: Old Extension Problems1217962 -Ref: Old Extension Problems-Footnote-11219480 -Node: Extension New Mechanism Goals1219537 -Ref: Extension New Mechanism Goals-Footnote-11222901 -Node: Extension Other Design Decisions1223090 -Node: Extension Future Growth1225203 -Node: Old Extension Mechanism1226039 -Node: Notes summary1227802 -Node: Basic Concepts1228984 -Node: Basic High Level1229665 -Ref: figure-general-flow1229947 -Ref: figure-process-flow1230632 -Ref: Basic High Level-Footnote-11233933 -Node: Basic Data Typing1234118 -Node: Glossary1237446 -Node: Copying1269393 -Node: GNU Free Documentation License1306932 -Node: Index1332050 +Node: I18N Functions592390 +Node: User-defined594041 +Node: Definition Syntax594846 +Ref: Definition Syntax-Footnote-1600533 +Node: Function Example600604 +Ref: Function Example-Footnote-1603526 +Node: Function Caveats603548 +Node: Calling A Function604066 +Node: Variable Scope605024 +Node: Pass By Value/Reference608018 +Node: Return Statement611517 +Node: Dynamic Typing614496 +Node: Indirect Calls615426 +Ref: Indirect Calls-Footnote-1625677 +Node: Functions Summary625805 +Node: Library Functions628510 +Ref: Library Functions-Footnote-1632117 +Ref: Library Functions-Footnote-2632260 +Node: Library Names632431 +Ref: Library Names-Footnote-1635891 +Ref: Library Names-Footnote-2636114 +Node: General Functions636200 +Node: Strtonum Function637303 +Node: Assert Function640325 +Node: Round Function643651 +Node: Cliff Random Function645192 +Node: Ordinal Functions646208 +Ref: Ordinal Functions-Footnote-1649271 +Ref: Ordinal Functions-Footnote-2649523 +Node: Join Function649733 +Ref: Join Function-Footnote-1651503 +Node: Getlocaltime Function651703 +Node: Readfile Function655445 +Node: Shell Quoting657417 +Node: Data File Management658818 +Node: Filetrans Function659450 +Node: Rewind Function663546 +Node: File Checking665456 +Ref: File Checking-Footnote-1666790 +Node: Empty Files666991 +Node: Ignoring Assigns668970 +Node: Getopt Function670520 +Ref: Getopt Function-Footnote-1681989 +Node: Passwd Functions682189 +Ref: Passwd Functions-Footnote-1691028 +Node: Group Functions691116 +Ref: Group Functions-Footnote-1699014 +Node: Walking Arrays699221 +Node: Library Functions Summary702229 +Node: Library Exercises703635 +Node: Sample Programs704100 +Node: Running Examples704870 +Node: Clones705598 +Node: Cut Program706822 +Node: Egrep Program716751 +Ref: Egrep Program-Footnote-1724263 +Node: Id Program724373 +Node: Split Program728053 +Ref: Split Program-Footnote-1731512 +Node: Tee Program731641 +Node: Uniq Program734431 +Node: Wc Program741857 +Ref: Wc Program-Footnote-1746112 +Node: Miscellaneous Programs746206 +Node: Dupword Program747419 +Node: Alarm Program749449 +Node: Translate Program754304 +Ref: Translate Program-Footnote-1758869 +Node: Labels Program759139 +Ref: Labels Program-Footnote-1762490 +Node: Word Sorting762574 +Node: History Sorting766646 +Node: Extract Program768481 +Node: Simple Sed776010 +Node: Igawk Program779084 +Ref: Igawk Program-Footnote-1793415 +Ref: Igawk Program-Footnote-2793617 +Ref: Igawk Program-Footnote-3793739 +Node: Anagram Program793854 +Node: Signature Program796916 +Node: Programs Summary798163 +Node: Programs Exercises799377 +Ref: Programs Exercises-Footnote-1803506 +Node: Advanced Features803597 +Node: Nondecimal Data805587 +Node: Array Sorting807178 +Node: Controlling Array Traversal807878 +Ref: Controlling Array Traversal-Footnote-1816245 +Node: Array Sorting Functions816363 +Ref: Array Sorting Functions-Footnote-1821454 +Node: Two-way I/O821650 +Ref: Two-way I/O-Footnote-1828201 +Ref: Two-way I/O-Footnote-2828388 +Node: TCP/IP Networking828470 +Node: Profiling831588 +Ref: Profiling-Footnote-1840260 +Node: Advanced Features Summary840583 +Node: Internationalization842427 +Node: I18N and L10N843907 +Node: Explaining gettext844594 +Ref: Explaining gettext-Footnote-1850486 +Ref: Explaining gettext-Footnote-2850671 +Node: Programmer i18n850836 +Ref: Programmer i18n-Footnote-1855785 +Node: Translator i18n855834 +Node: String Extraction856628 +Ref: String Extraction-Footnote-1857760 +Node: Printf Ordering857846 +Ref: Printf Ordering-Footnote-1860632 +Node: I18N Portability860696 +Ref: I18N Portability-Footnote-1863152 +Node: I18N Example863215 +Ref: I18N Example-Footnote-1866021 +Node: Gawk I18N866094 +Node: I18N Summary866739 +Node: Debugger868080 +Node: Debugging869102 +Node: Debugging Concepts869543 +Node: Debugging Terms871352 +Node: Awk Debugging873927 +Node: Sample Debugging Session874833 +Node: Debugger Invocation875367 +Node: Finding The Bug876753 +Node: List of Debugger Commands883231 +Node: Breakpoint Control884564 +Node: Debugger Execution Control888258 +Node: Viewing And Changing Data891620 +Node: Execution Stack894994 +Node: Debugger Info896631 +Node: Miscellaneous Debugger Commands900702 +Node: Readline Support905790 +Node: Limitations906686 +Node: Debugging Summary908795 +Node: Arbitrary Precision Arithmetic910074 +Node: Computer Arithmetic911559 +Ref: table-numeric-ranges915150 +Ref: Computer Arithmetic-Footnote-1915872 +Node: Math Definitions915929 +Ref: table-ieee-formats919243 +Ref: Math Definitions-Footnote-1919846 +Node: MPFR features919951 +Node: FP Math Caution921668 +Ref: FP Math Caution-Footnote-1922740 +Node: Inexactness of computations923109 +Node: Inexact representation924069 +Node: Comparing FP Values925429 +Node: Errors accumulate926511 +Node: Getting Accuracy927944 +Node: Try To Round930654 +Node: Setting precision931553 +Ref: table-predefined-precision-strings932250 +Node: Setting the rounding mode934080 +Ref: table-gawk-rounding-modes934454 +Ref: Setting the rounding mode-Footnote-1937862 +Node: Arbitrary Precision Integers938041 +Ref: Arbitrary Precision Integers-Footnote-1941216 +Node: Checking for MPFR941365 +Node: POSIX Floating Point Problems942662 +Ref: POSIX Floating Point Problems-Footnote-1946533 +Node: Floating point summary946571 +Node: Dynamic Extensions948761 +Node: Extension Intro950314 +Node: Plugin License951580 +Node: Extension Mechanism Outline952377 +Ref: figure-load-extension952816 +Ref: figure-register-new-function954381 +Ref: figure-call-new-function955473 +Node: Extension API Description957535 +Node: Extension API Functions Introduction959177 +Node: General Data Types964511 +Ref: General Data Types-Footnote-1971716 +Node: Memory Allocation Functions972015 +Ref: Memory Allocation Functions-Footnote-1975167 +Node: Constructor Functions975266 +Node: Registration Functions978265 +Node: Extension Functions978950 +Node: Exit Callback Functions984163 +Node: Extension Version String985413 +Node: Input Parsers986076 +Node: Output Wrappers998783 +Node: Two-way processors1003295 +Node: Printing Messages1005560 +Ref: Printing Messages-Footnote-11006731 +Node: Updating ERRNO1006884 +Node: Requesting Values1007623 +Ref: table-value-types-returned1008360 +Node: Accessing Parameters1009296 +Node: Symbol Table Access1010531 +Node: Symbol table by name1011043 +Node: Symbol table by cookie1012832 +Ref: Symbol table by cookie-Footnote-11017017 +Node: Cached values1017081 +Ref: Cached values-Footnote-11020617 +Node: Array Manipulation1020708 +Ref: Array Manipulation-Footnote-11021799 +Node: Array Data Types1021836 +Ref: Array Data Types-Footnote-11024494 +Node: Array Functions1024586 +Node: Flattening Arrays1028985 +Node: Creating Arrays1035926 +Node: Redirection API1040695 +Node: Extension API Variables1043537 +Node: Extension Versioning1044170 +Ref: gawk-api-version1044607 +Node: Extension API Informational Variables1046335 +Node: Extension API Boilerplate1047399 +Node: Changes from API V11051261 +Node: Finding Extensions1051921 +Node: Extension Example1052480 +Node: Internal File Description1053278 +Node: Internal File Ops1057358 +Ref: Internal File Ops-Footnote-11068758 +Node: Using Internal File Ops1068898 +Ref: Using Internal File Ops-Footnote-11071281 +Node: Extension Samples1071555 +Node: Extension Sample File Functions1073084 +Node: Extension Sample Fnmatch1080733 +Node: Extension Sample Fork1082220 +Node: Extension Sample Inplace1083438 +Node: Extension Sample Ord1086655 +Node: Extension Sample Readdir1087491 +Ref: table-readdir-file-types1088380 +Node: Extension Sample Revout1089185 +Node: Extension Sample Rev2way1089774 +Node: Extension Sample Read write array1090514 +Node: Extension Sample Readfile1092456 +Node: Extension Sample Time1093551 +Node: Extension Sample API Tests1094899 +Node: gawkextlib1095391 +Node: Extension summary1097838 +Node: Extension Exercises1101540 +Node: Language History1103038 +Node: V7/SVR3.11104694 +Node: SVR41106846 +Node: POSIX1108280 +Node: BTL1109659 +Node: POSIX/GNU1110388 +Node: Feature History1116166 +Node: Common Extensions1130531 +Node: Ranges and Locales1131814 +Ref: Ranges and Locales-Footnote-11136430 +Ref: Ranges and Locales-Footnote-21136457 +Ref: Ranges and Locales-Footnote-31136692 +Node: Contributors1136913 +Node: History summary1142473 +Node: Installation1143853 +Node: Gawk Distribution1144797 +Node: Getting1145281 +Node: Extracting1146242 +Node: Distribution contents1147880 +Node: Unix Installation1154222 +Node: Quick Installation1154904 +Node: Shell Startup Files1157318 +Node: Additional Configuration Options1158407 +Node: Configuration Philosophy1160396 +Node: Non-Unix Installation1162765 +Node: PC Installation1163225 +Node: PC Binary Installation1164063 +Node: PC Compiling1164498 +Node: PC Using1165615 +Node: Cygwin1168660 +Node: MSYS1169430 +Node: VMS Installation1169931 +Node: VMS Compilation1170722 +Ref: VMS Compilation-Footnote-11171951 +Node: VMS Dynamic Extensions1172009 +Node: VMS Installation Details1173694 +Node: VMS Running1175947 +Node: VMS GNV1180226 +Node: VMS Old Gawk1180961 +Node: Bugs1181432 +Node: Bug address1182095 +Node: Usenet1184492 +Node: Maintainers1185269 +Node: Other Versions1186645 +Node: Installation summary1193229 +Node: Notes1194264 +Node: Compatibility Mode1195129 +Node: Additions1195911 +Node: Accessing The Source1196836 +Node: Adding Code1198271 +Node: New Ports1204489 +Node: Derived Files1208977 +Ref: Derived Files-Footnote-11214462 +Ref: Derived Files-Footnote-21214497 +Ref: Derived Files-Footnote-31215095 +Node: Future Extensions1215209 +Node: Implementation Limitations1215867 +Node: Extension Design1217050 +Node: Old Extension Problems1218204 +Ref: Old Extension Problems-Footnote-11219722 +Node: Extension New Mechanism Goals1219779 +Ref: Extension New Mechanism Goals-Footnote-11223143 +Node: Extension Other Design Decisions1223332 +Node: Extension Future Growth1225445 +Node: Old Extension Mechanism1226281 +Node: Notes summary1228044 +Node: Basic Concepts1229226 +Node: Basic High Level1229907 +Ref: figure-general-flow1230189 +Ref: figure-process-flow1230874 +Ref: Basic High Level-Footnote-11234175 +Node: Basic Data Typing1234360 +Node: Glossary1237688 +Node: Copying1269635 +Node: GNU Free Documentation License1307174 +Node: Index1332292 End Tag Table |