Rename "any" to "isany"

This commit is contained in:
Dianne Skoll
2021-12-20 17:32:14 -05:00
parent 0b43099621
commit cde0e5883e
4 changed files with 36 additions and 36 deletions

View File

@@ -2358,7 +2358,7 @@ $TimeSep and $DateTimeSep when formatting its output. For example:
.PP
.RE
.TP
.B any(arg1 [,arg2, ..., argN]);
.B isany(arg1 [,arg2, ..., argN]);
Returns 1 if the first argument \fIarg1\fR is equal to any of the
subsequent arguments \fIarg2\fR through \fIargN\fR; returns 0 otherwise.
Also returns 0 if called with only one argument.
@@ -2369,7 +2369,7 @@ As an example, the following two expressions are equivalent:
.nf
(a == b) || (a == c) || (a == d) || (a == e)
any(a, b, c, d, e)
isany(a, b, c, d, e)
.fi
.RE
.TP
@@ -3753,7 +3753,7 @@ on the 15th of January, April, July, and October. You could make
four separate reminders, or you could use:
.PP
.nf
REM 15 SATISFY [any($Tm, 1, 4, 7, 10)] MSG 15th Reminder!
REM 15 SATISFY [isany($Tm, 1, 4, 7, 10)] MSG 15th Reminder!
.fi
.PP
This technique of using one \fBREM\fR command to calculate a trigger date

View File

@@ -58,7 +58,7 @@ static int FADusk (func_info *);
static int FAbs (func_info *);
static int FAccess (func_info *);
static int FAmpm (func_info *);
static int FAny (func_info *);
static int FIsAny (func_info *);
static int FArgs (func_info *);
static int FAsc (func_info *);
static int FBaseyr (func_info *);
@@ -210,7 +210,6 @@ BuiltinFunc Func[] = {
{ "adawn", 0, 1, 0, FADawn},
{ "adusk", 0, 1, 0, FADusk},
{ "ampm", 1, 3, 1, FAmpm },
{ "any", 1, NO_MAX, 1, FAny },
{ "args", 1, 1, 0, FArgs },
{ "asc", 1, 1, 1, FAsc },
{ "baseyr", 0, 0, 1, FBaseyr },
@@ -241,6 +240,7 @@ BuiltinFunc Func[] = {
{ "hour", 1, 1, 1, FHour },
{ "iif", 1, NO_MAX, 1, FIif },
{ "index", 2, 3, 1, FIndex },
{ "isany", 1, NO_MAX, 1, FIsAny },
{ "isdst", 0, 2, 0, FIsdst },
{ "isleap", 1, 1, 1, FIsleap },
{ "isomitted", 1, 1, 0, FIsomitted },
@@ -1037,12 +1037,12 @@ static int FPlural(func_info *info)
/***************************************************************/
/* */
/* FAny */
/* FIsAny */
/* Return 1 if the first arg equals any subsequent arg, 0 */
/* otherwise. */
/* */
/***************************************************************/
static int FAny(func_info *info)
static int FIsAny(func_info *info)
{
int i;
RetVal.type = INT_TYPE;

View File

@@ -3268,25 +3268,25 @@ $IntMin => -2147483648
abs(-2147483648) => Number too high
../tests/test.rem(594): Number too high
# The "any" function
set a any(1)
any(1) => 0
set a any("foo")
any("foo") => 0
set a any(1:00)
any(01:00) => 0
set a any(1, 2)
any(1, 2) => 0
set a any("foo", 2)
any("foo", 2) => 0
set a any(1:00, 2)
any(01:00, 2) => 0
set a any(1, 2, 1, 3)
any(1, 2, 1, 3) => 1
set a any("foo", 2, 3, "foo")
any("foo", 2, 3, "foo") => 1
set a any(1:00, 2, "foo", 2:00, 1:00, 9:00)
any(01:00, 2, "foo", 02:00, 01:00, 09:00) => 1
# The "isany" function
set a isany(1)
isany(1) => 0
set a isany("foo")
isany("foo") => 0
set a isany(1:00)
isany(01:00) => 0
set a isany(1, 2)
isany(1, 2) => 0
set a isany("foo", 2)
isany("foo", 2) => 0
set a isany(1:00, 2)
isany(01:00, 2) => 0
set a isany(1, 2, 1, 3)
isany(1, 2, 1, 3) => 1
set a isany("foo", 2, 3, "foo")
isany("foo", 2, 3, "foo") => 1
set a isany(1:00, 2, "foo", 2:00, 1:00, 9:00)
isany(01:00, 2, "foo", 02:00, 01:00, 09:00) => 1
# Shellescape
set a shellescape(" !\"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")

View File

@@ -593,16 +593,16 @@ set a $IntMin * (-1)
set a (-1) * $IntMin
set a abs($IntMin)
# The "any" function
set a any(1)
set a any("foo")
set a any(1:00)
set a any(1, 2)
set a any("foo", 2)
set a any(1:00, 2)
set a any(1, 2, 1, 3)
set a any("foo", 2, 3, "foo")
set a any(1:00, 2, "foo", 2:00, 1:00, 9:00)
# The "isany" function
set a isany(1)
set a isany("foo")
set a isany(1:00)
set a isany(1, 2)
set a isany("foo", 2)
set a isany(1:00, 2)
set a isany(1, 2, 1, 3)
set a isany("foo", 2, 3, "foo")
set a isany(1:00, 2, "foo", 2:00, 1:00, 9:00)
# Shellescape
set a shellescape(" !\"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")