NAME
call_other - call a function in an object
SYNOPSIS
varargs mixed call_other(mixed obj, string function, mixed args...)
CONFIG.H - MUDOS_CALL_OTHER_ARRAY
varargs mixed call_other(mixed obj, string function, mixed args...)
varargs mixed call_other(mixed *objs, string function, mixed args...)
DESCRIPTION
Call a function in an object. The first argument must be either an
object or a string. If it is a string, call_object() will be called
in the driver object to get the corresponding object.
Only non-private functions can be called with call_other(). If the
function is static, the object in which the function is called must
be the same as the object from which the function is called, or the
call will fail.
Any additional arguments to call_other() will be passed on to the
called function.
In LPC, obj->func(arg1, arg2, argn) can be used as a shorthand for
call_other(obj, "func", arg1, arg2, argn).
If config.h defines MUDOS_CALL_OTHER_ARRAY, the first argument may
be an array of objects and strings to call. All returnvalues will
then be returned as an array with equal size as the first argument.
The ({ ob1, ob2, ... })->func() shorthand will also work.
NB! This will complicate ALL call_other()s considerably.
ERRORS
An error will result if the first argument is not an object and not a
string.
Calling a function that does not exist, or a function that cannot be
called with call_other() because it is private or static, does not
result in an error but returns the value 0.
If the number of existing objects is equal to the value of the
ST_OTABSIZE field of the array returned by status(), where ST_OTABSIZE
is defined in the include file <status.h>, attempting to compile a new
object will crash the system.
SEE ALSO
kfun/clone_object, kfun/destruct_object, kfun/function_object