aboutsummaryrefslogtreecommitdiffstats
path: root/manuals
diff options
context:
space:
mode:
authorGavin Howard <gavin@yzena.com>2021-07-20 23:47:47 -0600
committerGavin Howard <gavin@yzena.com>2021-07-20 23:49:27 -0600
commitf4e36d5707c0857f1761b85b4187c1c2d85c1771 (patch)
treebfefa0458ac4052fac21a5df35a4a50ab3d61a97 /manuals
parente9f2581d6c5021d9bc5136e2053cab0171174501 (diff)
downloadplatform_external_bc-f4e36d5707c0857f1761b85b4187c1c2d85c1771.tar.gz
platform_external_bc-f4e36d5707c0857f1761b85b4187c1c2d85c1771.tar.bz2
platform_external_bc-f4e36d5707c0857f1761b85b4187c1c2d85c1771.zip
Change the keyword redefinition infrastructure
This changes it to use a command-line option. This is best because if a user encounters a problem; they *know* they are using my bc and can add the command-line option. This is also better because it allows the keyword to be used as variable and array names as well as function names, without editing the script. This has the double advantage that I can undo the change to the parser, though I need to keep the one line change to the lexer. The option is `-r` and `--redefine`, and they take an argument, which is the keyword to redefine. All docs and tests have been updated. Signed-off-by: Gavin Howard <gavin@yzena.com>
Diffstat (limited to 'manuals')
-rw-r--r--manuals/bc.1.md.in73
-rw-r--r--manuals/bc/A.191
-rw-r--r--manuals/bc/A.1.md65
-rw-r--r--manuals/bc/E.183
-rw-r--r--manuals/bc/E.1.md61
-rw-r--r--manuals/bc/EH.183
-rw-r--r--manuals/bc/EH.1.md61
-rw-r--r--manuals/bc/EHN.183
-rw-r--r--manuals/bc/EHN.1.md61
-rw-r--r--manuals/bc/EN.183
-rw-r--r--manuals/bc/EN.1.md61
-rw-r--r--manuals/bc/H.191
-rw-r--r--manuals/bc/H.1.md65
-rw-r--r--manuals/bc/HN.191
-rw-r--r--manuals/bc/HN.1.md65
-rw-r--r--manuals/bc/N.191
-rw-r--r--manuals/bc/N.1.md65
-rw-r--r--manuals/build.md5
18 files changed, 833 insertions, 445 deletions
diff --git a/manuals/bc.1.md.in b/manuals/bc.1.md.in
index f7b78fb9..f88c6cf2 100644
--- a/manuals/bc.1.md.in
+++ b/manuals/bc.1.md.in
@@ -57,9 +57,13 @@ the GNU bc(1).
{{ end }}
**Note**: If running this bc(1) on *any* script meant for another bc(1) gives a
-parse error, set the environment variable **BC_REDEFINE_KEYWORDS** to **1** (see
-the **ENVIRONMENT VARIABLES** section) and try again. It should parse correctly.
-If not, that is a bug and should be reported. See the **BUGS** section.
+parse error, it is probably because a word this bc(1) reserves as a keyword is
+used as the name of a function, variable, or array. To fix that, use the
+command-line option **-r** *keyword*, where *keyword* is the keyword that is
+used as a name in the script. For more information, see the **OPTIONS** section.
+
+If parsing scripts meant for other bc(1) implementations still does not work,
+that is a bug and should be reported. See the **BUGS** section.
# OPTIONS
@@ -195,6 +199,48 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
+**-r** *keyword*, **-\-redefine**=*keyword*
+
+: Redefines *keyword* in order to allow it to be used as a function, variable,
+ or array name. This is useful when this bc(1) gives parse errors when
+ parsing scripts meant for other bc(1) implementations.
+
+ The keywords this bc(1) allows to be redefined are:
+
+ * **abs**
+ * **continue**
+ * **divmod**
+ * **else**
+ * **halt**
+{{ A H N HN }}
+ * **irand**
+{{ end }}
+ * **last**
+ * **limits**
+ * **maxibase**
+ * **maxobase**
+{{ A H N HN }}
+ * **maxrand**
+{{ end }}
+ * **maxscale**
+ * **modexp**
+ * **print**
+{{ A H N HN }}
+ * **rand**
+{{ end }}
+ * **read**
+{{ A H N HN }}
+ * **seed**
+{{ end }}
+
+ If any of those keywords are used as a function, variable, or array name in
+ a script, use this option with the keyword as the argument. If multiple are
+ used, use this option for all of them; it can be used multiple times.
+
+ It is a fatal error to redefine keywords mandated by the POSIX standard. It
+ is a fatal error to attempt to redefine words that this bc(1) does not
+ reserve as keywords.
+
**-R**, **-\-no-read-prompt**
: Disables the read prompt in TTY mode. (The read prompt is only enabled in
@@ -1695,27 +1741,6 @@ bc(1) recognizes the following environment variables:
This environment variable overrides the default, which can be queried with
the **-h** or **-\-help** options.
-**BC_REDEFINE_KEYWORDS**
-
-: If this environment variable exists and contains an integer, then a non-zero
- value makes bc(1) allow the user to redefine keywords that do not exist in
- the bc standard, while zero causes bc(1) to give parse errors if keywords
- are not used as expected.
-
- This has several consequences.
-
- First, if a keyword is used before it is redefined, then the keyword acts
- normally.
-
- Second, redefining a keyword precludes any future use of that keyword during
- the execution of bc(1), except as the function that redefined it.
-
- Third, if an error occurs during the parsing of a function whose name is a
- redefined keyword, the keyword remains redefined, so it cannot be recovered.
-
- This environment variable overrides the default, which can be queried with
- the **-h** or **-\-help** options.
-
**BC_SIGINT_RESET**
: If bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section),
diff --git a/manuals/bc/A.1 b/manuals/bc/A.1
index a6c57487..469c489d 100644
--- a/manuals/bc/A.1
+++ b/manuals/bc/A.1
@@ -58,11 +58,16 @@ It also has many extensions and extra features beyond other
implementations.
.PP
\f[B]Note\f[R]: If running this bc(1) on \f[I]any\f[R] script meant for
-another bc(1) gives a parse error, set the environment variable
-\f[B]BC_REDEFINE_KEYWORDS\f[R] to \f[B]1\f[R] (see the \f[B]ENVIRONMENT
-VARIABLES\f[R] section) and try again.
-It should parse correctly.
-If not, that is a bug and should be reported.
+another bc(1) gives a parse error, it is probably because a word this
+bc(1) reserves as a keyword is used as the name of a function, variable,
+or array.
+To fix that, use the command-line option \f[B]-r\f[R] \f[I]keyword\f[R],
+where \f[I]keyword\f[R] is the keyword that is used as a name in the
+script.
+For more information, see the \f[B]OPTIONS\f[R] section.
+.PP
+If parsing scripts meant for other bc(1) implementations still does not
+work, that is a bug and should be reported.
See the \f[B]BUGS\f[R] section.
.SH OPTIONS
.PP
@@ -196,6 +201,59 @@ environment variables (see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
This is a \f[B]non-portable extension\f[R].
.RE
.TP
+\f[B]-r\f[R] \f[I]keyword\f[R], \f[B]--redefine\f[R]=\f[I]keyword\f[R]
+Redefines \f[I]keyword\f[R] in order to allow it to be used as a
+function, variable, or array name.
+This is useful when this bc(1) gives parse errors when parsing scripts
+meant for other bc(1) implementations.
+.RS
+.PP
+The keywords this bc(1) allows to be redefined are:
+.IP \[bu] 2
+\f[B]abs\f[R]
+.IP \[bu] 2
+\f[B]continue\f[R]
+.IP \[bu] 2
+\f[B]divmod\f[R]
+.IP \[bu] 2
+\f[B]else\f[R]
+.IP \[bu] 2
+\f[B]halt\f[R]
+.IP \[bu] 2
+\f[B]irand\f[R]
+.IP \[bu] 2
+\f[B]last\f[R]
+.IP \[bu] 2
+\f[B]limits\f[R]
+.IP \[bu] 2
+\f[B]maxibase\f[R]
+.IP \[bu] 2
+\f[B]maxobase\f[R]
+.IP \[bu] 2
+\f[B]maxrand\f[R]
+.IP \[bu] 2
+\f[B]maxscale\f[R]
+.IP \[bu] 2
+\f[B]modexp\f[R]
+.IP \[bu] 2
+\f[B]print\f[R]
+.IP \[bu] 2
+\f[B]rand\f[R]
+.IP \[bu] 2
+\f[B]read\f[R]
+.IP \[bu] 2
+\f[B]seed\f[R]
+.PP
+If any of those keywords are used as a function, variable, or array name
+in a script, use this option with the keyword as the argument.
+If multiple are used, use this option for all of them; it can be used
+multiple times.
+.PP
+It is a fatal error to redefine keywords mandated by the POSIX standard.
+It is a fatal error to attempt to redefine words that this bc(1) does
+not reserve as keywords.
+.RE
+.TP
\f[B]-R\f[R], \f[B]--no-read-prompt\f[R]
Disables the read prompt in TTY mode.
(The read prompt is only enabled in TTY mode.
@@ -1925,29 +1983,6 @@ This environment variable overrides the default, which can be queried
with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
.RE
.TP
-\f[B]BC_REDEFINE_KEYWORDS\f[R]
-If this environment variable exists and contains an integer, then a
-non-zero value makes bc(1) allow the user to redefine keywords that do
-not exist in the bc standard, while zero causes bc(1) to give parse
-errors if keywords are not used as expected.
-.RS
-.PP
-This has several consequences.
-.PP
-First, if a keyword is used before it is redefined, then the keyword
-acts normally.
-.PP
-Second, redefining a keyword precludes any future use of that keyword
-during the execution of bc(1), except as the function that redefined it.
-.PP
-Third, if an error occurs during the parsing of a function whose name is
-a redefined keyword, the keyword remains redefined, so it cannot be
-recovered.
-.PP
-This environment variable overrides the default, which can be queried
-with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
-.RE
-.TP
\f[B]BC_SIGINT_RESET\f[R]
If bc(1) is not in interactive mode (see the \f[B]INTERACTIVE MODE\f[R]
section), then this environment variable has no effect because bc(1)
diff --git a/manuals/bc/A.1.md b/manuals/bc/A.1.md
index b98b6060..682a5ac9 100644
--- a/manuals/bc/A.1.md
+++ b/manuals/bc/A.1.md
@@ -51,9 +51,13 @@ especially) the GNU bc(1). It also has many extensions and extra features beyond
other implementations.
**Note**: If running this bc(1) on *any* script meant for another bc(1) gives a
-parse error, set the environment variable **BC_REDEFINE_KEYWORDS** to **1** (see
-the **ENVIRONMENT VARIABLES** section) and try again. It should parse correctly.
-If not, that is a bug and should be reported. See the **BUGS** section.
+parse error, it is probably because a word this bc(1) reserves as a keyword is
+used as the name of a function, variable, or array. To fix that, use the
+command-line option **-r** *keyword*, where *keyword* is the keyword that is
+used as a name in the script. For more information, see the **OPTIONS** section.
+
+If parsing scripts meant for other bc(1) implementations still does not work,
+that is a bug and should be reported. See the **BUGS** section.
# OPTIONS
@@ -158,6 +162,40 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
+**-r** *keyword*, **-\-redefine**=*keyword*
+
+: Redefines *keyword* in order to allow it to be used as a function, variable,
+ or array name. This is useful when this bc(1) gives parse errors when
+ parsing scripts meant for other bc(1) implementations.
+
+ The keywords this bc(1) allows to be redefined are:
+
+ * **abs**
+ * **continue**
+ * **divmod**
+ * **else**
+ * **halt**
+ * **irand**
+ * **last**
+ * **limits**
+ * **maxibase**
+ * **maxobase**
+ * **maxrand**
+ * **maxscale**
+ * **modexp**
+ * **print**
+ * **rand**
+ * **read**
+ * **seed**
+
+ If any of those keywords are used as a function, variable, or array name in
+ a script, use this option with the keyword as the argument. If multiple are
+ used, use this option for all of them; it can be used multiple times.
+
+ It is a fatal error to redefine keywords mandated by the POSIX standard. It
+ is a fatal error to attempt to redefine words that this bc(1) does not
+ reserve as keywords.
+
**-R**, **-\-no-read-prompt**
: Disables the read prompt in TTY mode. (The read prompt is only enabled in
@@ -1609,27 +1647,6 @@ bc(1) recognizes the following environment variables:
This environment variable overrides the default, which can be queried with
the **-h** or **-\-help** options.
-**BC_REDEFINE_KEYWORDS**
-
-: If this environment variable exists and contains an integer, then a non-zero
- value makes bc(1) allow the user to redefine keywords that do not exist in
- the bc standard, while zero causes bc(1) to give parse errors if keywords
- are not used as expected.
-
- This has several consequences.
-
- First, if a keyword is used before it is redefined, then the keyword acts
- normally.
-
- Second, redefining a keyword precludes any future use of that keyword during
- the execution of bc(1), except as the function that redefined it.
-
- Third, if an error occurs during the parsing of a function whose name is a
- redefined keyword, the keyword remains redefined, so it cannot be recovered.
-
- This environment variable overrides the default, which can be queried with
- the **-h** or **-\-help** options.
-
**BC_SIGINT_RESET**
: If bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section),
diff --git a/manuals/bc/E.1 b/manuals/bc/E.1
index 03486f5b..c327d937 100644
--- a/manuals/bc/E.1
+++ b/manuals/bc/E.1
@@ -56,11 +56,16 @@ This bc(1) is a drop-in replacement for \f[I]any\f[R] bc(1), including
(and especially) the GNU bc(1).
.PP
\f[B]Note\f[R]: If running this bc(1) on \f[I]any\f[R] script meant for
-another bc(1) gives a parse error, set the environment variable
-\f[B]BC_REDEFINE_KEYWORDS\f[R] to \f[B]1\f[R] (see the \f[B]ENVIRONMENT
-VARIABLES\f[R] section) and try again.
-It should parse correctly.
-If not, that is a bug and should be reported.
+another bc(1) gives a parse error, it is probably because a word this
+bc(1) reserves as a keyword is used as the name of a function, variable,
+or array.
+To fix that, use the command-line option \f[B]-r\f[R] \f[I]keyword\f[R],
+where \f[I]keyword\f[R] is the keyword that is used as a name in the
+script.
+For more information, see the \f[B]OPTIONS\f[R] section.
+.PP
+If parsing scripts meant for other bc(1) implementations still does not
+work, that is a bug and should be reported.
See the \f[B]BUGS\f[R] section.
.SH OPTIONS
.PP
@@ -173,6 +178,51 @@ environment variables (see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
This is a \f[B]non-portable extension\f[R].
.RE
.TP
+\f[B]-r\f[R] \f[I]keyword\f[R], \f[B]--redefine\f[R]=\f[I]keyword\f[R]
+Redefines \f[I]keyword\f[R] in order to allow it to be used as a
+function, variable, or array name.
+This is useful when this bc(1) gives parse errors when parsing scripts
+meant for other bc(1) implementations.
+.RS
+.PP
+The keywords this bc(1) allows to be redefined are:
+.IP \[bu] 2
+\f[B]abs\f[R]
+.IP \[bu] 2
+\f[B]continue\f[R]
+.IP \[bu] 2
+\f[B]divmod\f[R]
+.IP \[bu] 2
+\f[B]else\f[R]
+.IP \[bu] 2
+\f[B]halt\f[R]
+.IP \[bu] 2
+\f[B]last\f[R]
+.IP \[bu] 2
+\f[B]limits\f[R]
+.IP \[bu] 2
+\f[B]maxibase\f[R]
+.IP \[bu] 2
+\f[B]maxobase\f[R]
+.IP \[bu] 2
+\f[B]maxscale\f[R]
+.IP \[bu] 2
+\f[B]modexp\f[R]
+.IP \[bu] 2
+\f[B]print\f[R]
+.IP \[bu] 2
+\f[B]read\f[R]
+.PP
+If any of those keywords are used as a function, variable, or array name
+in a script, use this option with the keyword as the argument.
+If multiple are used, use this option for all of them; it can be used
+multiple times.
+.PP
+It is a fatal error to redefine keywords mandated by the POSIX standard.
+It is a fatal error to attempt to redefine words that this bc(1) does
+not reserve as keywords.
+.RE
+.TP
\f[B]-R\f[R], \f[B]--no-read-prompt\f[R]
Disables the read prompt in TTY mode.
(The read prompt is only enabled in TTY mode.
@@ -1191,29 +1241,6 @@ This environment variable overrides the default, which can be queried
with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
.RE
.TP
-\f[B]BC_REDEFINE_KEYWORDS\f[R]
-If this environment variable exists and contains an integer, then a
-non-zero value makes bc(1) allow the user to redefine keywords that do
-not exist in the bc standard, while zero causes bc(1) to give parse
-errors if keywords are not used as expected.
-.RS
-.PP
-This has several consequences.
-.PP
-First, if a keyword is used before it is redefined, then the keyword
-acts normally.
-.PP
-Second, redefining a keyword precludes any future use of that keyword
-during the execution of bc(1), except as the function that redefined it.
-.PP
-Third, if an error occurs during the parsing of a function whose name is
-a redefined keyword, the keyword remains redefined, so it cannot be
-recovered.
-.PP
-This environment variable overrides the default, which can be queried
-with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
-.RE
-.TP
\f[B]BC_SIGINT_RESET\f[R]
If bc(1) is not in interactive mode (see the \f[B]INTERACTIVE MODE\f[R]
section), then this environment variable has no effect because bc(1)
diff --git a/manuals/bc/E.1.md b/manuals/bc/E.1.md
index dc03aa91..0a80d36e 100644
--- a/manuals/bc/E.1.md
+++ b/manuals/bc/E.1.md
@@ -50,9 +50,13 @@ This bc(1) is a drop-in replacement for *any* bc(1), including (and especially)
the GNU bc(1).
**Note**: If running this bc(1) on *any* script meant for another bc(1) gives a
-parse error, set the environment variable **BC_REDEFINE_KEYWORDS** to **1** (see
-the **ENVIRONMENT VARIABLES** section) and try again. It should parse correctly.
-If not, that is a bug and should be reported. See the **BUGS** section.
+parse error, it is probably because a word this bc(1) reserves as a keyword is
+used as the name of a function, variable, or array. To fix that, use the
+command-line option **-r** *keyword*, where *keyword* is the keyword that is
+used as a name in the script. For more information, see the **OPTIONS** section.
+
+If parsing scripts meant for other bc(1) implementations still does not work,
+that is a bug and should be reported. See the **BUGS** section.
# OPTIONS
@@ -142,6 +146,36 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
+**-r** *keyword*, **-\-redefine**=*keyword*
+
+: Redefines *keyword* in order to allow it to be used as a function, variable,
+ or array name. This is useful when this bc(1) gives parse errors when
+ parsing scripts meant for other bc(1) implementations.
+
+ The keywords this bc(1) allows to be redefined are:
+
+ * **abs**
+ * **continue**
+ * **divmod**
+ * **else**
+ * **halt**
+ * **last**
+ * **limits**
+ * **maxibase**
+ * **maxobase**
+ * **maxscale**
+ * **modexp**
+ * **print**
+ * **read**
+
+ If any of those keywords are used as a function, variable, or array name in
+ a script, use this option with the keyword as the argument. If multiple are
+ used, use this option for all of them; it can be used multiple times.
+
+ It is a fatal error to redefine keywords mandated by the POSIX standard. It
+ is a fatal error to attempt to redefine words that this bc(1) does not
+ reserve as keywords.
+
**-R**, **-\-no-read-prompt**
: Disables the read prompt in TTY mode. (The read prompt is only enabled in
@@ -990,27 +1024,6 @@ bc(1) recognizes the following environment variables:
This environment variable overrides the default, which can be queried with
the **-h** or **-\-help** options.
-**BC_REDEFINE_KEYWORDS**
-
-: If this environment variable exists and contains an integer, then a non-zero
- value makes bc(1) allow the user to redefine keywords that do not exist in
- the bc standard, while zero causes bc(1) to give parse errors if keywords
- are not used as expected.
-
- This has several consequences.
-
- First, if a keyword is used before it is redefined, then the keyword acts
- normally.
-
- Second, redefining a keyword precludes any future use of that keyword during
- the execution of bc(1), except as the function that redefined it.
-
- Third, if an error occurs during the parsing of a function whose name is a
- redefined keyword, the keyword remains redefined, so it cannot be recovered.
-
- This environment variable overrides the default, which can be queried with
- the **-h** or **-\-help** options.
-
**BC_SIGINT_RESET**
: If bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section),
diff --git a/manuals/bc/EH.1 b/manuals/bc/EH.1
index 3b66f98a..af9fb2fb 100644
--- a/manuals/bc/EH.1
+++ b/manuals/bc/EH.1
@@ -56,11 +56,16 @@ This bc(1) is a drop-in replacement for \f[I]any\f[R] bc(1), including
(and especially) the GNU bc(1).
.PP
\f[B]Note\f[R]: If running this bc(1) on \f[I]any\f[R] script meant for
-another bc(1) gives a parse error, set the environment variable
-\f[B]BC_REDEFINE_KEYWORDS\f[R] to \f[B]1\f[R] (see the \f[B]ENVIRONMENT
-VARIABLES\f[R] section) and try again.
-It should parse correctly.
-If not, that is a bug and should be reported.
+another bc(1) gives a parse error, it is probably because a word this
+bc(1) reserves as a keyword is used as the name of a function, variable,
+or array.
+To fix that, use the command-line option \f[B]-r\f[R] \f[I]keyword\f[R],
+where \f[I]keyword\f[R] is the keyword that is used as a name in the
+script.
+For more information, see the \f[B]OPTIONS\f[R] section.
+.PP
+If parsing scripts meant for other bc(1) implementations still does not
+work, that is a bug and should be reported.
See the \f[B]BUGS\f[R] section.
.SH OPTIONS
.PP
@@ -173,6 +178,51 @@ environment variables (see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
This is a \f[B]non-portable extension\f[R].
.RE
.TP
+\f[B]-r\f[R] \f[I]keyword\f[R], \f[B]--redefine\f[R]=\f[I]keyword\f[R]
+Redefines \f[I]keyword\f[R] in order to allow it to be used as a
+function, variable, or array name.
+This is useful when this bc(1) gives parse errors when parsing scripts
+meant for other bc(1) implementations.
+.RS
+.PP
+The keywords this bc(1) allows to be redefined are:
+.IP \[bu] 2
+\f[B]abs\f[R]
+.IP \[bu] 2
+\f[B]continue\f[R]
+.IP \[bu] 2
+\f[B]divmod\f[R]
+.IP \[bu] 2
+\f[B]else\f[R]
+.IP \[bu] 2
+\f[B]halt\f[R]
+.IP \[bu] 2
+\f[B]last\f[R]
+.IP \[bu] 2
+\f[B]limits\f[R]
+.IP \[bu] 2
+\f[B]maxibase\f[R]
+.IP \[bu] 2
+\f[B]maxobase\f[R]
+.IP \[bu] 2
+\f[B]maxscale\f[R]
+.IP \[bu] 2
+\f[B]modexp\f[R]
+.IP \[bu] 2
+\f[B]print\f[R]
+.IP \[bu] 2
+\f[B]read\f[R]
+.PP
+If any of those keywords are used as a function, variable, or array name
+in a script, use this option with the keyword as the argument.
+If multiple are used, use this option for all of them; it can be used
+multiple times.
+.PP
+It is a fatal error to redefine keywords mandated by the POSIX standard.
+It is a fatal error to attempt to redefine words that this bc(1) does
+not reserve as keywords.
+.RE
+.TP
\f[B]-R\f[R], \f[B]--no-read-prompt\f[R]
Disables the read prompt in TTY mode.
(The read prompt is only enabled in TTY mode.
@@ -1191,29 +1241,6 @@ This environment variable overrides the default, which can be queried
with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
.RE
.TP
-\f[B]BC_REDEFINE_KEYWORDS\f[R]
-If this environment variable exists and contains an integer, then a
-non-zero value makes bc(1) allow the user to redefine keywords that do
-not exist in the bc standard, while zero causes bc(1) to give parse
-errors if keywords are not used as expected.
-.RS
-.PP
-This has several consequences.
-.PP
-First, if a keyword is used before it is redefined, then the keyword
-acts normally.
-.PP
-Second, redefining a keyword precludes any future use of that keyword
-during the execution of bc(1), except as the function that redefined it.
-.PP
-Third, if an error occurs during the parsing of a function whose name is
-a redefined keyword, the keyword remains redefined, so it cannot be
-recovered.
-.PP
-This environment variable overrides the default, which can be queried
-with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
-.RE
-.TP
\f[B]BC_SIGINT_RESET\f[R]
If bc(1) is not in interactive mode (see the \f[B]INTERACTIVE MODE\f[R]
section), then this environment variable has no effect because bc(1)
diff --git a/manuals/bc/EH.1.md b/manuals/bc/EH.1.md
index 6d505cfe..3c08a439 100644
--- a/manuals/bc/EH.1.md
+++ b/manuals/bc/EH.1.md
@@ -50,9 +50,13 @@ This bc(1) is a drop-in replacement for *any* bc(1), including (and especially)
the GNU bc(1).
**Note**: If running this bc(1) on *any* script meant for another bc(1) gives a
-parse error, set the environment variable **BC_REDEFINE_KEYWORDS** to **1** (see
-the **ENVIRONMENT VARIABLES** section) and try again. It should parse correctly.
-If not, that is a bug and should be reported. See the **BUGS** section.
+parse error, it is probably because a word this bc(1) reserves as a keyword is
+used as the name of a function, variable, or array. To fix that, use the
+command-line option **-r** *keyword*, where *keyword* is the keyword that is
+used as a name in the script. For more information, see the **OPTIONS** section.
+
+If parsing scripts meant for other bc(1) implementations still does not work,
+that is a bug and should be reported. See the **BUGS** section.
# OPTIONS
@@ -142,6 +146,36 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
+**-r** *keyword*, **-\-redefine**=*keyword*
+
+: Redefines *keyword* in order to allow it to be used as a function, variable,
+ or array name. This is useful when this bc(1) gives parse errors when
+ parsing scripts meant for other bc(1) implementations.
+
+ The keywords this bc(1) allows to be redefined are:
+
+ * **abs**
+ * **continue**
+ * **divmod**
+ * **else**
+ * **halt**
+ * **last**
+ * **limits**
+ * **maxibase**
+ * **maxobase**
+ * **maxscale**
+ * **modexp**
+ * **print**
+ * **read**
+
+ If any of those keywords are used as a function, variable, or array name in
+ a script, use this option with the keyword as the argument. If multiple are
+ used, use this option for all of them; it can be used multiple times.
+
+ It is a fatal error to redefine keywords mandated by the POSIX standard. It
+ is a fatal error to attempt to redefine words that this bc(1) does not
+ reserve as keywords.
+
**-R**, **-\-no-read-prompt**
: Disables the read prompt in TTY mode. (The read prompt is only enabled in
@@ -990,27 +1024,6 @@ bc(1) recognizes the following environment variables:
This environment variable overrides the default, which can be queried with
the **-h** or **-\-help** options.
-**BC_REDEFINE_KEYWORDS**
-
-: If this environment variable exists and contains an integer, then a non-zero
- value makes bc(1) allow the user to redefine keywords that do not exist in
- the bc standard, while zero causes bc(1) to give parse errors if keywords
- are not used as expected.
-
- This has several consequences.
-
- First, if a keyword is used before it is redefined, then the keyword acts
- normally.
-
- Second, redefining a keyword precludes any future use of that keyword during
- the execution of bc(1), except as the function that redefined it.
-
- Third, if an error occurs during the parsing of a function whose name is a
- redefined keyword, the keyword remains redefined, so it cannot be recovered.
-
- This environment variable overrides the default, which can be queried with
- the **-h** or **-\-help** options.
-
**BC_SIGINT_RESET**
: If bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section),
diff --git a/manuals/bc/EHN.1 b/manuals/bc/EHN.1
index 4ed4674a..0dc3c3c3 100644
--- a/manuals/bc/EHN.1
+++ b/manuals/bc/EHN.1
@@ -56,11 +56,16 @@ This bc(1) is a drop-in replacement for \f[I]any\f[R] bc(1), including
(and especially) the GNU bc(1).
.PP
\f[B]Note\f[R]: If running this bc(1) on \f[I]any\f[R] script meant for
-another bc(1) gives a parse error, set the environment variable
-\f[B]BC_REDEFINE_KEYWORDS\f[R] to \f[B]1\f[R] (see the \f[B]ENVIRONMENT
-VARIABLES\f[R] section) and try again.
-It should parse correctly.
-If not, that is a bug and should be reported.
+another bc(1) gives a parse error, it is probably because a word this
+bc(1) reserves as a keyword is used as the name of a function, variable,
+or array.
+To fix that, use the command-line option \f[B]-r\f[R] \f[I]keyword\f[R],
+where \f[I]keyword\f[R] is the keyword that is used as a name in the
+script.
+For more information, see the \f[B]OPTIONS\f[R] section.
+.PP
+If parsing scripts meant for other bc(1) implementations still does not
+work, that is a bug and should be reported.
See the \f[B]BUGS\f[R] section.
.SH OPTIONS
.PP
@@ -173,6 +178,51 @@ environment variables (see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
This is a \f[B]non-portable extension\f[R].
.RE
.TP
+\f[B]-r\f[R] \f[I]keyword\f[R], \f[B]--redefine\f[R]=\f[I]keyword\f[R]
+Redefines \f[I]keyword\f[R] in order to allow it to be used as a
+function, variable, or array name.
+This is useful when this bc(1) gives parse errors when parsing scripts
+meant for other bc(1) implementations.
+.RS
+.PP
+The keywords this bc(1) allows to be redefined are:
+.IP \[bu] 2
+\f[B]abs\f[R]
+.IP \[bu] 2
+\f[B]continue\f[R]
+.IP \[bu] 2
+\f[B]divmod\f[R]
+.IP \[bu] 2
+\f[B]else\f[R]
+.IP \[bu] 2
+\f[B]halt\f[R]
+.IP \[bu] 2
+\f[B]last\f[R]
+.IP \[bu] 2
+\f[B]limits\f[R]
+.IP \[bu] 2
+\f[B]maxibase\f[R]
+.IP \[bu] 2
+\f[B]maxobase\f[R]
+.IP \[bu] 2
+\f[B]maxscale\f[R]
+.IP \[bu] 2
+\f[B]modexp\f[R]
+.IP \[bu] 2
+\f[B]print\f[R]
+.IP \[bu] 2
+\f[B]read\f[R]
+.PP
+If any of those keywords are used as a function, variable, or array name
+in a script, use this option with the keyword as the argument.
+If multiple are used, use this option for all of them; it can be used
+multiple times.
+.PP
+It is a fatal error to redefine keywords mandated by the POSIX standard.
+It is a fatal error to attempt to redefine words that this bc(1) does
+not reserve as keywords.
+.RE
+.TP
\f[B]-R\f[R], \f[B]--no-read-prompt\f[R]
Disables the read prompt in TTY mode.
(The read prompt is only enabled in TTY mode.
@@ -1191,29 +1241,6 @@ This environment variable overrides the default, which can be queried
with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
.RE
.TP
-\f[B]BC_REDEFINE_KEYWORDS\f[R]
-If this environment variable exists and contains an integer, then a
-non-zero value makes bc(1) allow the user to redefine keywords that do
-not exist in the bc standard, while zero causes bc(1) to give parse
-errors if keywords are not used as expected.
-.RS
-.PP
-This has several consequences.
-.PP
-First, if a keyword is used before it is redefined, then the keyword
-acts normally.
-.PP
-Second, redefining a keyword precludes any future use of that keyword
-during the execution of bc(1), except as the function that redefined it.
-.PP
-Third, if an error occurs during the parsing of a function whose name is
-a redefined keyword, the keyword remains redefined, so it cannot be
-recovered.
-.PP
-This environment variable overrides the default, which can be queried
-with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
-.RE
-.TP
\f[B]BC_SIGINT_RESET\f[R]
If bc(1) is not in interactive mode (see the \f[B]INTERACTIVE MODE\f[R]
section), then this environment variable has no effect because bc(1)
diff --git a/manuals/bc/EHN.1.md b/manuals/bc/EHN.1.md
index 384da7dd..6392419e 100644
--- a/manuals/bc/EHN.1.md
+++ b/manuals/bc/EHN.1.md
@@ -50,9 +50,13 @@ This bc(1) is a drop-in replacement for *any* bc(1), including (and especially)
the GNU bc(1).
**Note**: If running this bc(1) on *any* script meant for another bc(1) gives a
-parse error, set the environment variable **BC_REDEFINE_KEYWORDS** to **1** (see
-the **ENVIRONMENT VARIABLES** section) and try again. It should parse correctly.
-If not, that is a bug and should be reported. See the **BUGS** section.
+parse error, it is probably because a word this bc(1) reserves as a keyword is
+used as the name of a function, variable, or array. To fix that, use the
+command-line option **-r** *keyword*, where *keyword* is the keyword that is
+used as a name in the script. For more information, see the **OPTIONS** section.
+
+If parsing scripts meant for other bc(1) implementations still does not work,
+that is a bug and should be reported. See the **BUGS** section.
# OPTIONS
@@ -142,6 +146,36 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
+**-r** *keyword*, **-\-redefine**=*keyword*
+
+: Redefines *keyword* in order to allow it to be used as a function, variable,
+ or array name. This is useful when this bc(1) gives parse errors when
+ parsing scripts meant for other bc(1) implementations.
+
+ The keywords this bc(1) allows to be redefined are:
+
+ * **abs**
+ * **continue**
+ * **divmod**
+ * **else**
+ * **halt**
+ * **last**
+ * **limits**
+ * **maxibase**
+ * **maxobase**
+ * **maxscale**
+ * **modexp**
+ * **print**
+ * **read**
+
+ If any of those keywords are used as a function, variable, or array name in
+ a script, use this option with the keyword as the argument. If multiple are
+ used, use this option for all of them; it can be used multiple times.
+
+ It is a fatal error to redefine keywords mandated by the POSIX standard. It
+ is a fatal error to attempt to redefine words that this bc(1) does not
+ reserve as keywords.
+
**-R**, **-\-no-read-prompt**
: Disables the read prompt in TTY mode. (The read prompt is only enabled in
@@ -990,27 +1024,6 @@ bc(1) recognizes the following environment variables:
This environment variable overrides the default, which can be queried with
the **-h** or **-\-help** options.
-**BC_REDEFINE_KEYWORDS**
-
-: If this environment variable exists and contains an integer, then a non-zero
- value makes bc(1) allow the user to redefine keywords that do not exist in
- the bc standard, while zero causes bc(1) to give parse errors if keywords
- are not used as expected.
-
- This has several consequences.
-
- First, if a keyword is used before it is redefined, then the keyword acts
- normally.
-
- Second, redefining a keyword precludes any future use of that keyword during
- the execution of bc(1), except as the function that redefined it.
-
- Third, if an error occurs during the parsing of a function whose name is a
- redefined keyword, the keyword remains redefined, so it cannot be recovered.
-
- This environment variable overrides the default, which can be queried with
- the **-h** or **-\-help** options.
-
**BC_SIGINT_RESET**
: If bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section),
diff --git a/manuals/bc/EN.1 b/manuals/bc/EN.1
index a170b79f..3991186a 100644
--- a/manuals/bc/EN.1
+++ b/manuals/bc/EN.1
@@ -56,11 +56,16 @@ This bc(1) is a drop-in replacement for \f[I]any\f[R] bc(1), including
(and especially) the GNU bc(1).
.PP
\f[B]Note\f[R]: If running this bc(1) on \f[I]any\f[R] script meant for
-another bc(1) gives a parse error, set the environment variable
-\f[B]BC_REDEFINE_KEYWORDS\f[R] to \f[B]1\f[R] (see the \f[B]ENVIRONMENT
-VARIABLES\f[R] section) and try again.
-It should parse correctly.
-If not, that is a bug and should be reported.
+another bc(1) gives a parse error, it is probably because a word this
+bc(1) reserves as a keyword is used as the name of a function, variable,
+or array.
+To fix that, use the command-line option \f[B]-r\f[R] \f[I]keyword\f[R],
+where \f[I]keyword\f[R] is the keyword that is used as a name in the
+script.
+For more information, see the \f[B]OPTIONS\f[R] section.
+.PP
+If parsing scripts meant for other bc(1) implementations still does not
+work, that is a bug and should be reported.
See the \f[B]BUGS\f[R] section.
.SH OPTIONS
.PP
@@ -173,6 +178,51 @@ environment variables (see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
This is a \f[B]non-portable extension\f[R].
.RE
.TP
+\f[B]-r\f[R] \f[I]keyword\f[R], \f[B]--redefine\f[R]=\f[I]keyword\f[R]
+Redefines \f[I]keyword\f[R] in order to allow it to be used as a
+function, variable, or array name.
+This is useful when this bc(1) gives parse errors when parsing scripts
+meant for other bc(1) implementations.
+.RS
+.PP
+The keywords this bc(1) allows to be redefined are:
+.IP \[bu] 2
+\f[B]abs\f[R]
+.IP \[bu] 2
+\f[B]continue\f[R]
+.IP \[bu] 2
+\f[B]divmod\f[R]
+.IP \[bu] 2
+\f[B]else\f[R]
+.IP \[bu] 2
+\f[B]halt\f[R]
+.IP \[bu] 2
+\f[B]last\f[R]
+.IP \[bu] 2
+\f[B]limits\f[R]
+.IP \[bu] 2
+\f[B]maxibase\f[R]
+.IP \[bu] 2
+\f[B]maxobase\f[R]
+.IP \[bu] 2
+\f[B]maxscale\f[R]
+.IP \[bu] 2
+\f[B]modexp\f[R]
+.IP \[bu] 2
+\f[B]print\f[R]
+.IP \[bu] 2
+\f[B]read\f[R]
+.PP
+If any of those keywords are used as a function, variable, or array name
+in a script, use this option with the keyword as the argument.
+If multiple are used, use this option for all of them; it can be used
+multiple times.
+.PP
+It is a fatal error to redefine keywords mandated by the POSIX standard.
+It is a fatal error to attempt to redefine words that this bc(1) does
+not reserve as keywords.
+.RE
+.TP
\f[B]-R\f[R], \f[B]--no-read-prompt\f[R]
Disables the read prompt in TTY mode.
(The read prompt is only enabled in TTY mode.
@@ -1191,29 +1241,6 @@ This environment variable overrides the default, which can be queried
with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
.RE
.TP
-\f[B]BC_REDEFINE_KEYWORDS\f[R]
-If this environment variable exists and contains an integer, then a
-non-zero value makes bc(1) allow the user to redefine keywords that do
-not exist in the bc standard, while zero causes bc(1) to give parse
-errors if keywords are not used as expected.
-.RS
-.PP
-This has several consequences.
-.PP
-First, if a keyword is used before it is redefined, then the keyword
-acts normally.
-.PP
-Second, redefining a keyword precludes any future use of that keyword
-during the execution of bc(1), except as the function that redefined it.
-.PP
-Third, if an error occurs during the parsing of a function whose name is
-a redefined keyword, the keyword remains redefined, so it cannot be
-recovered.
-.PP
-This environment variable overrides the default, which can be queried
-with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
-.RE
-.TP
\f[B]BC_SIGINT_RESET\f[R]
If bc(1) is not in interactive mode (see the \f[B]INTERACTIVE MODE\f[R]
section), then this environment variable has no effect because bc(1)
diff --git a/manuals/bc/EN.1.md b/manuals/bc/EN.1.md
index e4e490da..1554b2c4 100644
--- a/manuals/bc/EN.1.md
+++ b/manuals/bc/EN.1.md
@@ -50,9 +50,13 @@ This bc(1) is a drop-in replacement for *any* bc(1), including (and especially)
the GNU bc(1).
**Note**: If running this bc(1) on *any* script meant for another bc(1) gives a
-parse error, set the environment variable **BC_REDEFINE_KEYWORDS** to **1** (see
-the **ENVIRONMENT VARIABLES** section) and try again. It should parse correctly.
-If not, that is a bug and should be reported. See the **BUGS** section.
+parse error, it is probably because a word this bc(1) reserves as a keyword is
+used as the name of a function, variable, or array. To fix that, use the
+command-line option **-r** *keyword*, where *keyword* is the keyword that is
+used as a name in the script. For more information, see the **OPTIONS** section.
+
+If parsing scripts meant for other bc(1) implementations still does not work,
+that is a bug and should be reported. See the **BUGS** section.
# OPTIONS
@@ -142,6 +146,36 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
+**-r** *keyword*, **-\-redefine**=*keyword*
+
+: Redefines *keyword* in order to allow it to be used as a function, variable,
+ or array name. This is useful when this bc(1) gives parse errors when
+ parsing scripts meant for other bc(1) implementations.
+
+ The keywords this bc(1) allows to be redefined are:
+
+ * **abs**
+ * **continue**
+ * **divmod**
+ * **else**
+ * **halt**
+ * **last**
+ * **limits**
+ * **maxibase**
+ * **maxobase**
+ * **maxscale**
+ * **modexp**
+ * **print**
+ * **read**
+
+ If any of those keywords are used as a function, variable, or array name in
+ a script, use this option with the keyword as the argument. If multiple are
+ used, use this option for all of them; it can be used multiple times.
+
+ It is a fatal error to redefine keywords mandated by the POSIX standard. It
+ is a fatal error to attempt to redefine words that this bc(1) does not
+ reserve as keywords.
+
**-R**, **-\-no-read-prompt**
: Disables the read prompt in TTY mode. (The read prompt is only enabled in
@@ -990,27 +1024,6 @@ bc(1) recognizes the following environment variables:
This environment variable overrides the default, which can be queried with
the **-h** or **-\-help** options.
-**BC_REDEFINE_KEYWORDS**
-
-: If this environment variable exists and contains an integer, then a non-zero
- value makes bc(1) allow the user to redefine keywords that do not exist in
- the bc standard, while zero causes bc(1) to give parse errors if keywords
- are not used as expected.
-
- This has several consequences.
-
- First, if a keyword is used before it is redefined, then the keyword acts
- normally.
-
- Second, redefining a keyword precludes any future use of that keyword during
- the execution of bc(1), except as the function that redefined it.
-
- Third, if an error occurs during the parsing of a function whose name is a
- redefined keyword, the keyword remains redefined, so it cannot be recovered.
-
- This environment variable overrides the default, which can be queried with
- the **-h** or **-\-help** options.
-
**BC_SIGINT_RESET**
: If bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section),
diff --git a/manuals/bc/H.1 b/manuals/bc/H.1
index da0b8744..4ccf053a 100644
--- a/manuals/bc/H.1
+++ b/manuals/bc/H.1
@@ -58,11 +58,16 @@ It also has many extensions and extra features beyond other
implementations.
.PP
\f[B]Note\f[R]: If running this bc(1) on \f[I]any\f[R] script meant for
-another bc(1) gives a parse error, set the environment variable
-\f[B]BC_REDEFINE_KEYWORDS\f[R] to \f[B]1\f[R] (see the \f[B]ENVIRONMENT
-VARIABLES\f[R] section) and try again.
-It should parse correctly.
-If not, that is a bug and should be reported.
+another bc(1) gives a parse error, it is probably because a word this
+bc(1) reserves as a keyword is used as the name of a function, variable,
+or array.
+To fix that, use the command-line option \f[B]-r\f[R] \f[I]keyword\f[R],
+where \f[I]keyword\f[R] is the keyword that is used as a name in the
+script.
+For more information, see the \f[B]OPTIONS\f[R] section.
+.PP
+If parsing scripts meant for other bc(1) implementations still does not
+work, that is a bug and should be reported.
See the \f[B]BUGS\f[R] section.
.SH OPTIONS
.PP
@@ -196,6 +201,59 @@ environment variables (see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
This is a \f[B]non-portable extension\f[R].
.RE
.TP
+\f[B]-r\f[R] \f[I]keyword\f[R], \f[B]--redefine\f[R]=\f[I]keyword\f[R]
+Redefines \f[I]keyword\f[R] in order to allow it to be used as a
+function, variable, or array name.
+This is useful when this bc(1) gives parse errors when parsing scripts
+meant for other bc(1) implementations.
+.RS
+.PP
+The keywords this bc(1) allows to be redefined are:
+.IP \[bu] 2
+\f[B]abs\f[R]
+.IP \[bu] 2
+\f[B]continue\f[R]
+.IP \[bu] 2
+\f[B]divmod\f[R]
+.IP \[bu] 2
+\f[B]else\f[R]
+.IP \[bu] 2
+\f[B]halt\f[R]
+.IP \[bu] 2
+\f[B]irand\f[R]
+.IP \[bu] 2
+\f[B]last\f[R]
+.IP \[bu] 2
+\f[B]limits\f[R]
+.IP \[bu] 2
+\f[B]maxibase\f[R]
+.IP \[bu] 2
+\f[B]maxobase\f[R]
+.IP \[bu] 2
+\f[B]maxrand\f[R]
+.IP \[bu] 2
+\f[B]maxscale\f[R]
+.IP \[bu] 2
+\f[B]modexp\f[R]
+.IP \[bu] 2
+\f[B]print\f[R]
+.IP \[bu] 2
+\f[B]rand\f[R]
+.IP \[bu] 2
+\f[B]read\f[R]
+.IP \[bu] 2
+\f[B]seed\f[R]
+.PP
+If any of those keywords are used as a function, variable, or array name
+in a script, use this option with the keyword as the argument.
+If multiple are used, use this option for all of them; it can be used
+multiple times.
+.PP
+It is a fatal error to redefine keywords mandated by the POSIX standard.
+It is a fatal error to attempt to redefine words that this bc(1) does
+not reserve as keywords.
+.RE
+.TP
\f[B]-R\f[R], \f[B]--no-read-prompt\f[R]
Disables the read prompt in TTY mode.
(The read prompt is only enabled in TTY mode.
@@ -1925,29 +1983,6 @@ This environment variable overrides the default, which can be queried
with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
.RE
.TP
-\f[B]BC_REDEFINE_KEYWORDS\f[R]
-If this environment variable exists and contains an integer, then a
-non-zero value makes bc(1) allow the user to redefine keywords that do
-not exist in the bc standard, while zero causes bc(1) to give parse
-errors if keywords are not used as expected.
-.RS
-.PP
-This has several consequences.
-.PP
-First, if a keyword is used before it is redefined, then the keyword
-acts normally.
-.PP
-Second, redefining a keyword precludes any future use of that keyword
-during the execution of bc(1), except as the function that redefined it.
-.PP
-Third, if an error occurs during the parsing of a function whose name is
-a redefined keyword, the keyword remains redefined, so it cannot be
-recovered.
-.PP
-This environment variable overrides the default, which can be queried
-with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
-.RE
-.TP
\f[B]BC_SIGINT_RESET\f[R]
If bc(1) is not in interactive mode (see the \f[B]INTERACTIVE MODE\f[R]
section), then this environment variable has no effect because bc(1)
diff --git a/manuals/bc/H.1.md b/manuals/bc/H.1.md
index b235cb5a..ea7f8a19 100644
--- a/manuals/bc/H.1.md
+++ b/manuals/bc/H.1.md
@@ -51,9 +51,13 @@ especially) the GNU bc(1). It also has many extensions and extra features beyond
other implementations.
**Note**: If running this bc(1) on *any* script meant for another bc(1) gives a
-parse error, set the environment variable **BC_REDEFINE_KEYWORDS** to **1** (see
-the **ENVIRONMENT VARIABLES** section) and try again. It should parse correctly.
-If not, that is a bug and should be reported. See the **BUGS** section.
+parse error, it is probably because a word this bc(1) reserves as a keyword is
+used as the name of a function, variable, or array. To fix that, use the
+command-line option **-r** *keyword*, where *keyword* is the keyword that is
+used as a name in the script. For more information, see the **OPTIONS** section.
+
+If parsing scripts meant for other bc(1) implementations still does not work,
+that is a bug and should be reported. See the **BUGS** section.
# OPTIONS
@@ -158,6 +162,40 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
+**-r** *keyword*, **-\-redefine**=*keyword*
+
+: Redefines *keyword* in order to allow it to be used as a function, variable,
+ or array name. This is useful when this bc(1) gives parse errors when
+ parsing scripts meant for other bc(1) implementations.
+
+ The keywords this bc(1) allows to be redefined are:
+
+ * **abs**
+ * **continue**
+ * **divmod**
+ * **else**
+ * **halt**
+ * **irand**
+ * **last**
+ * **limits**
+ * **maxibase**
+ * **maxobase**
+ * **maxrand**
+ * **maxscale**
+ * **modexp**
+ * **print**
+ * **rand**
+ * **read**
+ * **seed**
+
+ If any of those keywords are used as a function, variable, or array name in
+ a script, use this option with the keyword as the argument. If multiple are
+ used, use this option for all of them; it can be used multiple times.
+
+ It is a fatal error to redefine keywords mandated by the POSIX standard. It
+ is a fatal error to attempt to redefine words that this bc(1) does not
+ reserve as keywords.
+
**-R**, **-\-no-read-prompt**
: Disables the read prompt in TTY mode. (The read prompt is only enabled in
@@ -1609,27 +1647,6 @@ bc(1) recognizes the following environment variables:
This environment variable overrides the default, which can be queried with
the **-h** or **-\-help** options.
-**BC_REDEFINE_KEYWORDS**
-
-: If this environment variable exists and contains an integer, then a non-zero
- value makes bc(1) allow the user to redefine keywords that do not exist in
- the bc standard, while zero causes bc(1) to give parse errors if keywords
- are not used as expected.
-
- This has several consequences.
-
- First, if a keyword is used before it is redefined, then the keyword acts
- normally.
-
- Second, redefining a keyword precludes any future use of that keyword during
- the execution of bc(1), except as the function that redefined it.
-
- Third, if an error occurs during the parsing of a function whose name is a
- redefined keyword, the keyword remains redefined, so it cannot be recovered.
-
- This environment variable overrides the default, which can be queried with
- the **-h** or **-\-help** options.
-
**BC_SIGINT_RESET**
: If bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section),
diff --git a/manuals/bc/HN.1 b/manuals/bc/HN.1
index b62abb2b..63e88c4f 100644
--- a/manuals/bc/HN.1
+++ b/manuals/bc/HN.1
@@ -58,11 +58,16 @@ It also has many extensions and extra features beyond other
implementations.
.PP
\f[B]Note\f[R]: If running this bc(1) on \f[I]any\f[R] script meant for
-another bc(1) gives a parse error, set the environment variable
-\f[B]BC_REDEFINE_KEYWORDS\f[R] to \f[B]1\f[R] (see the \f[B]ENVIRONMENT
-VARIABLES\f[R] section) and try again.
-It should parse correctly.
-If not, that is a bug and should be reported.
+another bc(1) gives a parse error, it is probably because a word this
+bc(1) reserves as a keyword is used as the name of a function, variable,
+or array.
+To fix that, use the command-line option \f[B]-r\f[R] \f[I]keyword\f[R],
+where \f[I]keyword\f[R] is the keyword that is used as a name in the
+script.
+For more information, see the \f[B]OPTIONS\f[R] section.
+.PP
+If parsing scripts meant for other bc(1) implementations still does not
+work, that is a bug and should be reported.
See the \f[B]BUGS\f[R] section.
.SH OPTIONS
.PP
@@ -196,6 +201,59 @@ environment variables (see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
This is a \f[B]non-portable extension\f[R].
.RE
.TP
+\f[B]-r\f[R] \f[I]keyword\f[R], \f[B]--redefine\f[R]=\f[I]keyword\f[R]
+Redefines \f[I]keyword\f[R] in order to allow it to be used as a
+function, variable, or array name.
+This is useful when this bc(1) gives parse errors when parsing scripts
+meant for other bc(1) implementations.
+.RS
+.PP
+The keywords this bc(1) allows to be redefined are:
+.IP \[bu] 2
+\f[B]abs\f[R]
+.IP \[bu] 2
+\f[B]continue\f[R]
+.IP \[bu] 2
+\f[B]divmod\f[R]
+.IP \[bu] 2
+\f[B]else\f[R]
+.IP \[bu] 2
+\f[B]halt\f[R]
+.IP \[bu] 2
+\f[B]irand\f[R]
+.IP \[bu] 2
+\f[B]last\f[R]
+.IP \[bu] 2
+\f[B]limits\f[R]
+.IP \[bu] 2
+\f[B]maxibase\f[R]
+.IP \[bu] 2
+\f[B]maxobase\f[R]
+.IP \[bu] 2
+\f[B]maxrand\f[R]
+.IP \[bu] 2
+\f[B]maxscale\f[R]
+.IP \[bu] 2
+\f[B]modexp\f[R]
+.IP \[bu] 2
+\f[B]print\f[R]
+.IP \[bu] 2
+\f[B]rand\f[R]
+.IP \[bu] 2
+\f[B]read\f[R]
+.IP \[bu] 2
+\f[B]seed\f[R]
+.PP
+If any of those keywords are used as a function, variable, or array name
+in a script, use this option with the keyword as the argument.
+If multiple are used, use this option for all of them; it can be used
+multiple times.
+.PP
+It is a fatal error to redefine keywords mandated by the POSIX standard.
+It is a fatal error to attempt to redefine words that this bc(1) does
+not reserve as keywords.
+.RE
+.TP
\f[B]-R\f[R], \f[B]--no-read-prompt\f[R]
Disables the read prompt in TTY mode.
(The read prompt is only enabled in TTY mode.
@@ -1925,29 +1983,6 @@ This environment variable overrides the default, which can be queried
with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
.RE
.TP
-\f[B]BC_REDEFINE_KEYWORDS\f[R]
-If this environment variable exists and contains an integer, then a
-non-zero value makes bc(1) allow the user to redefine keywords that do
-not exist in the bc standard, while zero causes bc(1) to give parse
-errors if keywords are not used as expected.
-.RS
-.PP
-This has several consequences.
-.PP
-First, if a keyword is used before it is redefined, then the keyword
-acts normally.
-.PP
-Second, redefining a keyword precludes any future use of that keyword
-during the execution of bc(1), except as the function that redefined it.
-.PP
-Third, if an error occurs during the parsing of a function whose name is
-a redefined keyword, the keyword remains redefined, so it cannot be
-recovered.
-.PP
-This environment variable overrides the default, which can be queried
-with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
-.RE
-.TP
\f[B]BC_SIGINT_RESET\f[R]
If bc(1) is not in interactive mode (see the \f[B]INTERACTIVE MODE\f[R]
section), then this environment variable has no effect because bc(1)
diff --git a/manuals/bc/HN.1.md b/manuals/bc/HN.1.md
index dbefef91..041bacd7 100644
--- a/manuals/bc/HN.1.md
+++ b/manuals/bc/HN.1.md
@@ -51,9 +51,13 @@ especially) the GNU bc(1). It also has many extensions and extra features beyond
other implementations.
**Note**: If running this bc(1) on *any* script meant for another bc(1) gives a
-parse error, set the environment variable **BC_REDEFINE_KEYWORDS** to **1** (see
-the **ENVIRONMENT VARIABLES** section) and try again. It should parse correctly.
-If not, that is a bug and should be reported. See the **BUGS** section.
+parse error, it is probably because a word this bc(1) reserves as a keyword is
+used as the name of a function, variable, or array. To fix that, use the
+command-line option **-r** *keyword*, where *keyword* is the keyword that is
+used as a name in the script. For more information, see the **OPTIONS** section.
+
+If parsing scripts meant for other bc(1) implementations still does not work,
+that is a bug and should be reported. See the **BUGS** section.
# OPTIONS
@@ -158,6 +162,40 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
+**-r** *keyword*, **-\-redefine**=*keyword*
+
+: Redefines *keyword* in order to allow it to be used as a function, variable,
+ or array name. This is useful when this bc(1) gives parse errors when
+ parsing scripts meant for other bc(1) implementations.
+
+ The keywords this bc(1) allows to be redefined are:
+
+ * **abs**
+ * **continue**
+ * **divmod**
+ * **else**
+ * **halt**
+ * **irand**
+ * **last**
+ * **limits**
+ * **maxibase**
+ * **maxobase**
+ * **maxrand**
+ * **maxscale**
+ * **modexp**
+ * **print**
+ * **rand**
+ * **read**
+ * **seed**
+
+ If any of those keywords are used as a function, variable, or array name in
+ a script, use this option with the keyword as the argument. If multiple are
+ used, use this option for all of them; it can be used multiple times.
+
+ It is a fatal error to redefine keywords mandated by the POSIX standard. It
+ is a fatal error to attempt to redefine words that this bc(1) does not
+ reserve as keywords.
+
**-R**, **-\-no-read-prompt**
: Disables the read prompt in TTY mode. (The read prompt is only enabled in
@@ -1609,27 +1647,6 @@ bc(1) recognizes the following environment variables:
This environment variable overrides the default, which can be queried with
the **-h** or **-\-help** options.
-**BC_REDEFINE_KEYWORDS**
-
-: If this environment variable exists and contains an integer, then a non-zero
- value makes bc(1) allow the user to redefine keywords that do not exist in
- the bc standard, while zero causes bc(1) to give parse errors if keywords
- are not used as expected.
-
- This has several consequences.
-
- First, if a keyword is used before it is redefined, then the keyword acts
- normally.
-
- Second, redefining a keyword precludes any future use of that keyword during
- the execution of bc(1), except as the function that redefined it.
-
- Third, if an error occurs during the parsing of a function whose name is a
- redefined keyword, the keyword remains redefined, so it cannot be recovered.
-
- This environment variable overrides the default, which can be queried with
- the **-h** or **-\-help** options.
-
**BC_SIGINT_RESET**
: If bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section),
diff --git a/manuals/bc/N.1 b/manuals/bc/N.1
index 8da1643b..73f5478b 100644
--- a/manuals/bc/N.1
+++ b/manuals/bc/N.1
@@ -58,11 +58,16 @@ It also has many extensions and extra features beyond other
implementations.
.PP
\f[B]Note\f[R]: If running this bc(1) on \f[I]any\f[R] script meant for
-another bc(1) gives a parse error, set the environment variable
-\f[B]BC_REDEFINE_KEYWORDS\f[R] to \f[B]1\f[R] (see the \f[B]ENVIRONMENT
-VARIABLES\f[R] section) and try again.
-It should parse correctly.
-If not, that is a bug and should be reported.
+another bc(1) gives a parse error, it is probably because a word this
+bc(1) reserves as a keyword is used as the name of a function, variable,
+or array.
+To fix that, use the command-line option \f[B]-r\f[R] \f[I]keyword\f[R],
+where \f[I]keyword\f[R] is the keyword that is used as a name in the
+script.
+For more information, see the \f[B]OPTIONS\f[R] section.
+.PP
+If parsing scripts meant for other bc(1) implementations still does not
+work, that is a bug and should be reported.
See the \f[B]BUGS\f[R] section.
.SH OPTIONS
.PP
@@ -196,6 +201,59 @@ environment variables (see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
This is a \f[B]non-portable extension\f[R].
.RE
.TP
+\f[B]-r\f[R] \f[I]keyword\f[R], \f[B]--redefine\f[R]=\f[I]keyword\f[R]
+Redefines \f[I]keyword\f[R] in order to allow it to be used as a
+function, variable, or array name.
+This is useful when this bc(1) gives parse errors when parsing scripts
+meant for other bc(1) implementations.
+.RS
+.PP
+The keywords this bc(1) allows to be redefined are:
+.IP \[bu] 2
+\f[B]abs\f[R]
+.IP \[bu] 2
+\f[B]continue\f[R]
+.IP \[bu] 2
+\f[B]divmod\f[R]
+.IP \[bu] 2
+\f[B]else\f[R]
+.IP \[bu] 2
+\f[B]halt\f[R]
+.IP \[bu] 2
+\f[B]irand\f[R]
+.IP \[bu] 2
+\f[B]last\f[R]
+.IP \[bu] 2
+\f[B]limits\f[R]
+.IP \[bu] 2
+\f[B]maxibase\f[R]
+.IP \[bu] 2
+\f[B]maxobase\f[R]
+.IP \[bu] 2
+\f[B]maxrand\f[R]
+.IP \[bu] 2
+\f[B]maxscale\f[R]
+.IP \[bu] 2
+\f[B]modexp\f[R]
+.IP \[bu] 2
+\f[B]print\f[R]
+.IP \[bu] 2
+\f[B]rand\f[R]
+.IP \[bu] 2
+\f[B]read\f[R]
+.IP \[bu] 2
+\f[B]seed\f[R]
+.PP
+If any of those keywords are used as a function, variable, or array name
+in a script, use this option with the keyword as the argument.
+If multiple are used, use this option for all of them; it can be used
+multiple times.
+.PP
+It is a fatal error to redefine keywords mandated by the POSIX standard.
+It is a fatal error to attempt to redefine words that this bc(1) does
+not reserve as keywords.
+.RE
+.TP
\f[B]-R\f[R], \f[B]--no-read-prompt\f[R]
Disables the read prompt in TTY mode.
(The read prompt is only enabled in TTY mode.
@@ -1925,29 +1983,6 @@ This environment variable overrides the default, which can be queried
with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
.RE
.TP
-\f[B]BC_REDEFINE_KEYWORDS\f[R]
-If this environment variable exists and contains an integer, then a
-non-zero value makes bc(1) allow the user to redefine keywords that do
-not exist in the bc standard, while zero causes bc(1) to give parse
-errors if keywords are not used as expected.
-.RS
-.PP
-This has several consequences.
-.PP
-First, if a keyword is used before it is redefined, then the keyword
-acts normally.
-.PP
-Second, redefining a keyword precludes any future use of that keyword
-during the execution of bc(1), except as the function that redefined it.
-.PP
-Third, if an error occurs during the parsing of a function whose name is
-a redefined keyword, the keyword remains redefined, so it cannot be
-recovered.
-.PP
-This environment variable overrides the default, which can be queried
-with the \f[B]-h\f[R] or \f[B]--help\f[R] options.
-.RE
-.TP
\f[B]BC_SIGINT_RESET\f[R]
If bc(1) is not in interactive mode (see the \f[B]INTERACTIVE MODE\f[R]
section), then this environment variable has no effect because bc(1)
diff --git a/manuals/bc/N.1.md b/manuals/bc/N.1.md
index 499f53cc..4d79f96a 100644
--- a/manuals/bc/N.1.md
+++ b/manuals/bc/N.1.md
@@ -51,9 +51,13 @@ especially) the GNU bc(1). It also has many extensions and extra features beyond
other implementations.
**Note**: If running this bc(1) on *any* script meant for another bc(1) gives a
-parse error, set the environment variable **BC_REDEFINE_KEYWORDS** to **1** (see
-the **ENVIRONMENT VARIABLES** section) and try again. It should parse correctly.
-If not, that is a bug and should be reported. See the **BUGS** section.
+parse error, it is probably because a word this bc(1) reserves as a keyword is
+used as the name of a function, variable, or array. To fix that, use the
+command-line option **-r** *keyword*, where *keyword* is the keyword that is
+used as a name in the script. For more information, see the **OPTIONS** section.
+
+If parsing scripts meant for other bc(1) implementations still does not work,
+that is a bug and should be reported. See the **BUGS** section.
# OPTIONS
@@ -158,6 +162,40 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
+**-r** *keyword*, **-\-redefine**=*keyword*
+
+: Redefines *keyword* in order to allow it to be used as a function, variable,
+ or array name. This is useful when this bc(1) gives parse errors when
+ parsing scripts meant for other bc(1) implementations.
+
+ The keywords this bc(1) allows to be redefined are:
+
+ * **abs**
+ * **continue**
+ * **divmod**
+ * **else**
+ * **halt**
+ * **irand**
+ * **last**
+ * **limits**
+ * **maxibase**
+ * **maxobase**
+ * **maxrand**
+ * **maxscale**
+ * **modexp**
+ * **print**
+ * **rand**
+ * **read**
+ * **seed**
+
+ If any of those keywords are used as a function, variable, or array name in
+ a script, use this option with the keyword as the argument. If multiple are
+ used, use this option for all of them; it can be used multiple times.
+
+ It is a fatal error to redefine keywords mandated by the POSIX standard. It
+ is a fatal error to attempt to redefine words that this bc(1) does not
+ reserve as keywords.
+
**-R**, **-\-no-read-prompt**
: Disables the read prompt in TTY mode. (The read prompt is only enabled in
@@ -1609,27 +1647,6 @@ bc(1) recognizes the following environment variables:
This environment variable overrides the default, which can be queried with
the **-h** or **-\-help** options.
-**BC_REDEFINE_KEYWORDS**
-
-: If this environment variable exists and contains an integer, then a non-zero
- value makes bc(1) allow the user to redefine keywords that do not exist in
- the bc standard, while zero causes bc(1) to give parse errors if keywords
- are not used as expected.
-
- This has several consequences.
-
- First, if a keyword is used before it is redefined, then the keyword acts
- normally.
-
- Second, redefining a keyword precludes any future use of that keyword during
- the execution of bc(1), except as the function that redefined it.
-
- Third, if an error occurs during the parsing of a function whose name is a
- redefined keyword, the keyword remains redefined, so it cannot be recovered.
-
- This environment variable overrides the default, which can be queried with
- the **-h** or **-\-help** options.
-
**BC_SIGINT_RESET**
: If bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section),
diff --git a/manuals/build.md b/manuals/build.md
index be7a1530..f8fc7863 100644
--- a/manuals/build.md
+++ b/manuals/build.md
@@ -533,11 +533,6 @@ environment variables to override them, is below:
| | banner when in | | |
| | interactive mode. | | |
| --------------- | -------------------- | ------------ | -------------------- |
-| bc.redefine_kws | Whether to allow the | 0 | BC_REDEFINE_KEYWORDS |
-| | user to redefine bc | | |
-| | keywords as function | | |
-| | names. | | |
-| --------------- | -------------------- | ------------ | -------------------- |
| bc.sigint_reset | Whether SIGINT will | 1 | BC_SIGINT_RESET |
| | reset bc, instead of | | |
| | exiting, when in | | |