typefuncs
MudOSa4DGD/doc/language/typefuncs · 829 B
From the archive MudOSa4DGD-30.06.98.tar.gz
Download the archive « Back to the archive contents
If config.h defines MUDOS_TYPEFUNCS, the following macros will be
defined.
intp(var) returns 1 if var is of type int
floatp(var) returns 1 if var is of type float
stringp(var) returns 1 if var is of type string
objectp(var) returns 1 if var is of type object
arrayp(var) returns 1 if var is of type mixed*
mapp(var) returns 1 if var is of type mapping
With MUDOS_EXTRA_TYPEFUNCS being defined in config.h, some extra
namespace-baggage is also included (for backwards compatibility).
pointerp(var) returns 1 if var is of type mixed*
mappingp(var) returns 1 if var is of type mapping
Otherwise, these functions will return 0.
NOTICE
For checking a variable for several types at once, the use
of switch combined with typeof is STRONGLY recommended for
optimized result.
SEE ALSO
language/types, kfun/typeof