int
arrayp(mixed
arg
)
Returns 1
if arg
is an array, 0
(zero) otherwise.
intp()
, programp()
, mappingp()
, stringp()
, objectp()
,
multisetp()
, floatp()
, functionp()
int
callablep(mixed
arg
)
Returns 1
if arg
is a callable, 0
(zero) otherwise.
mappingp()
, programp()
, arrayp()
, stringp()
, objectp()
,
multisetp()
, floatp()
, intp()
int
destructedp(mixed
arg
)
Returns 1
if arg
is a destructed object, 0
(zero) otherwise.
zero_type
, undefinedp
, intp
int
floatp(mixed
arg
)
Returns 1
if arg
is a float, 0
(zero) otherwise.
intp()
, programp()
, arrayp()
, multisetp()
, objectp()
,
mappingp()
, stringp()
, functionp()
int
functionp(mixed
arg
)
Returns 1
if arg
is a function, 0
(zero) otherwise.
mappingp()
, programp()
, arrayp()
, stringp()
, objectp()
,
multisetp()
, floatp()
, intp()
int
intp(mixed
arg
)
Returns 1
if arg
is an int, 0
(zero) otherwise.
mappingp()
, programp()
, arrayp()
, stringp()
, objectp()
,
multisetp()
, floatp()
, functionp()
int
mappingp(mixed
arg
)
Returns 1
if arg
is a mapping, 0
(zero) otherwise.
intp()
, programp()
, arrayp()
, stringp()
, objectp()
,
multisetp()
, floatp()
, functionp()
int
multisetp(mixed
arg
)
Returns 1
if arg
is a multiset, 0
(zero) otherwise.
intp()
, programp()
, arrayp()
, stringp()
, objectp()
,
mappingp()
, floatp()
, functionp()
int
programp(mixed
arg
)
Returns 1
if arg
is a program, 0
(zero) otherwise.
mappingp()
, intp()
, arrayp()
, stringp()
, objectp()
,
multisetp()
, floatp()
, functionp()
int
undefinedp(mixed
arg
)
Returns 1
if arg
is undefined, 0
(zero) otherwise.
zero_type
, destructedp
, intp
type
_typeof(mixed
x
)
Return the runtime type of x
.
typeof()
array
indices(string
|array
|mapping
|multiset
|object
x
)
Return an array of all valid indices for the value x
.
x
| For strings and arrays this is simply an array of ascending numbers. |
| For mappings and multisets, the array might contain any value. |
| For objects which define For other objects an array with the names of all non-protected symbols is returned. |
values()
, types()
, lfun::_indices()
array
values(string
|array
|mapping
|multiset
|object
x
)
Return an array of all possible values from indexing the value
x
.
x
| For strings an array of int with the ISO10646 codes of the characters in the string is returned. |
| For a multiset an array filled with ones ( |
| For arrays a single-level copy of |
| For mappings the array may contain any value. |
| For objects which define For other objects an array with the values of all non-protected symbols is returned. |
indices()
, types()
, lfun::_values()
array
(type
) types(string
|array
|mapping
|multiset
|object
|program
x
)
Return an array with the types of all valid indices for the value x
.
x
| For strings this is simply an array with int |
| For arrays, mappings and multisets this is simply an array with mixed. |
| For objects which define For other objects an array with type types for all non-protected symbols is returned. |
This function was added in Pike 7.9.
indices()
, values()
, lfun::_types()
array
(multiset
(Pike.Annotation
)) annotations(object
|program
|function
(:void
) x
, bool
|void
recurse
)
Return an array with the annotations for all symbols in x
.
x
| For objects which define For other objects an array with annotations for all non-protected symbols is returned. |
| Returns an array with annotations for all non-protected constant symbols. |
recurse
Include annotations recursively added via inherits.
The order of the resulting array is the same as that of indices()
for the same x
.
This function was added in Pike 8.1.
indices()
, values()
, types()
, lfun::_annotations()
,
::_annotations()
, Program.annotations
int
get_weak_flag(array
|mapping
|multiset
m
)
Returns the weak flag settings for m
. It's a combination of
Pike.WEAK_INDICES
and Pike.WEAK_VALUES
.
int
zero_type(mixed
a
)
Return the type of zero.
There are many types of zeros out there, or at least there are two.
One is returned by normal functions, and one returned by mapping
lookups and find_call_out()
when what you looked for wasn't there.
The only way to separate these two kinds of zeros is zero_type()
.
When doing a find_call_out()
or mapping lookup, zero_type()
on
this value will return 1
if there was no such thing present in
the mapping, or if no such call_out could be found.
If the argument to zero_type()
is a destructed object or a function
in a destructed object, 2
will be returned.
In all other cases zero_type()
will return 0
(zero).
find_call_out()
string
function_name(function
(:void
)|program
f
)
Return the name of the function or program f
.
If f
is a global function defined in the runtime 0
(zero) will be returned.
function_object()
object
function_object(function
(:void
) f
)
Return the object the function f
is in.
If f
is a global function defined in the runtime 0
(zero) will be returned.
Zero will also be returned if f
is a constant in the
parent class. In that case function_program()
can be
used to get the parent program.
function_name()
, function_program()
program
function_program(function
(:void
)|program
f
)
Return the program the function f
is in.
If f
is a global function defined in the runtime 0
(zero) will be returned.
function_name()
, function_object()
program
|function
(:void
) object_program(mixed
o
)
Return the program from which o
was instantiated. If the
object was instantiated from a class using parent references
the generating function will be returned.
If o
is not an object or has been destructed 0
(zero)
will be returned.
array
(int
|mapping
(string
:array
(int
))) get_profiling_info(program
prog
)
Get profiling information.
Returns an array with two elements.
Array | |||||||||
| The first element is the number of times the program | ||||||||
| The second element is mapping from function name to an array with three elements.
|
This function is only available if the runtime was compiled with the option --with-profiling.
type
|zero
typeof_identifier(program
p
, string
identifier
)
Allows access to the static type of an identifier ("member") in a program.
The static type of p->identifier
, or UNDEFINED
if it can not be determined, be it because identifier
does not
exist in p
or for other reasons.
bool
deprecated_typep(type
t
)
Checks if the supplied type has the "deprecated" attribute. This would generally only be true in static types of identifiers that have been marked as __deprecated__.
1
if the type has the "deprecated" attribute,
0
otherwise.