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-2904-g50e0725
Date: Thu, 12 Oct 2017 15:42:45 -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  50e072541c754793195f640961af7feba08ebdd1 (commit)
      from  f76b8ad694e2862def3b643a9a29cdddfdb51c97 (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=50e072541c754793195f640961af7feba08ebdd1

commit 50e072541c754793195f640961af7feba08ebdd1
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Oct 12 22:42:06 2017 +0300

    Document namespaces in the man page and reference card.

diff --git a/doc/ChangeLog b/doc/ChangeLog
index f3a1858..d42ba60 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-12         Arnold D. Robbins     <address@hidden>
+
+       * gawk.1: Documents namespaces.
+       * awkcard.in: Ditto.
+
 2017-10-10         Arnold D. Robbins     <address@hidden>
 
        * gawktexi.in (Readfile Function): Fix the code for the naive
diff --git a/doc/awkcard.in b/doc/awkcard.in
index 31e37a8..78d6c55 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -47,7 +47,8 @@
 .ES
 .in +.2i
 .nf
-\*(FRAction Statements        9
+\*(FRAcknowledgements 9
+Action Statements     9
 Arrays        7
 Awk Program Execution 5
 Bit Manipulation Functions (\*(GK)    17
@@ -70,6 +71,7 @@ Input Control        13
 Internationalization (\*(GK)  18
 Lines And Statements  4
 Localization (\*(GK)  12
+Namespaces    12
 Numeric Functions     15
 Output Control        13
 Pattern Elements      8
@@ -88,9 +90,6 @@ Variables    5\*(CX
 .sp .4
 .TD
 .fi
-\*(CD\*(FRArnold Robbins wrote this reference card.
-We thank
-Brian Kernighan and Michael Brennan who reviewed it.
 .sp .4
 .SL
 .sp .4
@@ -523,7 +522,7 @@ T}
 \*(CL\*(FCBINMODE\fP   T{
 Controls ``binary'' mode for all file I/O.  Values of 1, 2, or 3,
 indicate input, output, or all files, respectively, should use binary
-I/O.  \*(CR(Not \*(NK.)  \*(CLApplies only to non-POSIX systems.
+I/O.  \*(CR(Not \*(NK.)  \*(CLOnly for non-POSIX systems.
 \*(CBFor \*(GK, string values of \*(FC"r"\fP, or \*(FC"w"\fP specify
 that input files, or output files, respectively, should use binary I/O.
 Use \*(FC"rw"\fP or \*(FC"wr"\fP for all files.\*(CX
@@ -967,6 +966,14 @@ lp8 lp8 lp8 lp8.
 \*(FC\e"\fP~double quote~\*(FC\e/\fP~forward slash\*(CX
 .TE
 .EB "\s+2\f(HBESCAPE SEQUENCES\*(FR\s0"
+.sp
+.\" --- Acknowledgements
+.ES
+.fi
+\*(CD\*(FRArnold Robbins wrote this reference card.
+We thank
+Brian Kernighan and Michael Brennan who reviewed it.\*(CX
+.EB "\s+2\f(HBACKNOWLEDGMENTS\*(FR\s0"
 .BT
 
 .\" --- Records
@@ -1276,6 +1283,26 @@ Usable only with the \*(FC|&\*(FR two-way I/O operator.
 Similar, but use UDP/IP instead of TCP/IP.\*(CL
 .in -.2i
 .EB "\s+2\f(HBSPECIAL FILENAMES\*(FR\s0"
+.sp .5
+.\" --- Namespaces
+.ES
+.fi
+\*(CDA
+\*(FIqualified name\fP
+consists of a two simple identifiers joined by a double colon
+(\*(FC::\fP).
+The left identifier is the namespace and the right one
+is the variable within it.
+All non-qualified names are treated as if in the
+``current'' namespace; the default namespace is \*(FCawk\fP.
+However, simple identifiers consisting solely of upper-case
+letters are forced into the
+\*(FCawk\fP
+namespace.
+You change the current namespace with an
+\*(address@hidden "\*(FIname\^\*(FC"\*(FR
+directive.\*(CB
+.EB "\s+2\f(HBNAMESPACES\*(FR\s0"
 
 .BT
 
diff --git a/doc/gawk.1 b/doc/gawk.1
index c55ceca..b78dd0e 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -13,7 +13,7 @@
 .              if \w'\(rq' .ds rq "\(rq
 .      \}
 .\}
-.TH GAWK 1 "Oct 01 2017" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Oct 12 2017" "Free Software Foundation" "Utility Commands"
 .SH NAME
 gawk \- pattern scanning and processing language
 .SH SYNOPSIS
@@ -578,9 +578,11 @@ pattern-action statements,
 and optional function definitions.
 .RS
 .PP
address@hidden "\fIfilename\fB"
address@hidden "\fIfilename\^\fB"
 .br
address@hidden "\fIfilename\fB"
address@hidden "\fIfilename\^\fB"
+.br
address@hidden "\fIname\^\fB"
 .br
 \fIpattern\fB  { \fIaction statements\fB }\fR
 .br
@@ -1498,6 +1500,37 @@ You can do this by creating an element in the subarray 
and then
 deleting it with the
 .B delete
 statement.
+.SS Namespaces
+.I Gawk
+provides a simple
+.I namespace
+facility to help work around the fact that all variables in
+AWK are global.
+.PP
+A
+.I "qualified name"
+consists of a two simple identifiers joined by a double colon
+.RB ( :: ).
+The left-hand identifier represents the namespace and the right-hand
+identifier is the variable within it.
+All simple (non-qualified) names are considered to be in the
+``current'' namespace; the default namespace is
+.BR awk .
+However, simple identifiers consisting solely of upper-case
+letters are forced into the
+.B awk
+namespace, even if the current namespace is different.
+.PP
+You change the current namespace with an
address@hidden "\fIname\^\fB"\fR
+directive.
+.PP
+The standard predefined builtin function names may not be used as
+namespace names.  The names of additional functions provided by
+.I gawk
+may be used as namespace names or as simple identifiers in other
+namespaces.
+For more details, see \*(EP.
 .SS Variable Typing And Conversion
 .PP
 Variables and fields
@@ -1646,7 +1679,7 @@ regular expression constants.  Thus,
 .B /a\e52b/
 is equivalent to
 .BR /a\e*b/ .
-.SS "Regexp Constants"
+.SS Regexp Constants
 A regular expression constant is a sequence of characters enclosed
 between forward slashes (like
 .BR /value/ ).

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

Summary of changes:
 doc/ChangeLog  |  5 +++++
 doc/awkcard.in | 37 ++++++++++++++++++++++++++++++++-----
 doc/gawk.1     | 41 +++++++++++++++++++++++++++++++++++++----
 3 files changed, 74 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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