ldmud-3.3.719/
ldmud-3.3.719/doc/
ldmud-3.3.719/doc/efun.de/
ldmud-3.3.719/doc/efun/
ldmud-3.3.719/doc/man/
ldmud-3.3.719/doc/other/
ldmud-3.3.719/mud/
ldmud-3.3.719/mud/heaven7/
ldmud-3.3.719/mud/lp-245/
ldmud-3.3.719/mud/lp-245/banish/
ldmud-3.3.719/mud/lp-245/doc/
ldmud-3.3.719/mud/lp-245/doc/examples/
ldmud-3.3.719/mud/lp-245/doc/sefun/
ldmud-3.3.719/mud/lp-245/log/
ldmud-3.3.719/mud/lp-245/obj/Go/
ldmud-3.3.719/mud/lp-245/players/lars/
ldmud-3.3.719/mud/lp-245/room/death/
ldmud-3.3.719/mud/lp-245/room/maze1/
ldmud-3.3.719/mud/lp-245/room/sub/
ldmud-3.3.719/mud/lp-245/secure/
ldmud-3.3.719/mud/sticklib/
ldmud-3.3.719/mud/sticklib/src/
ldmud-3.3.719/mudlib/deprecated/
ldmud-3.3.719/mudlib/uni-crasher/
ldmud-3.3.719/pkg/
ldmud-3.3.719/pkg/debugger/
ldmud-3.3.719/pkg/diff/
ldmud-3.3.719/pkg/misc/
ldmud-3.3.719/src/
ldmud-3.3.719/src/autoconf/
ldmud-3.3.719/src/ptmalloc/
ldmud-3.3.719/src/util/
ldmud-3.3.719/src/util/erq/
ldmud-3.3.719/src/util/indent/hosts/next/
ldmud-3.3.719/src/util/xerq/
ldmud-3.3.719/src/util/xerq/lpc/
ldmud-3.3.719/src/util/xerq/lpc/www/
ldmud-3.3.719/test/generic/
ldmud-3.3.719/test/inc/
ldmud-3.3.719/test/t-0000398/
ldmud-3.3.719/test/t-0000548/
ldmud-3.3.719/test/t-030925/
ldmud-3.3.719/test/t-040413/
ldmud-3.3.719/test/t-041124/
ldmud-3.3.719/test/t-language/
SYNOPSIS
        mixed apply(closure cl, ...)

DESCRIPTION
        Evaluates the closure <cl> with the following arguments.
        If the last argument is an array or struct, it will be
        flattened: ie. the array/struct itself will be removed and its
        contents added to the argument list of <cl>

        If <cl> is not a closure, it will simply be returned (and all
        other arguments are ignored).

EXAMPLES
        The flattening of the last argument is the important difference
        between apply() and funcall(). For example:

        mixed eval(object ob, string func, mixed *args)
        {
            return apply(#'call_other, ob, func, args);
        }

        This will result in calling

          ob->func(args[0],args[1],...,args[sizeof(args)-1]).

        Using funcall() instead of apply() would have given us

          ob->func(args).


        Of course, with the '...' operator we could also write

        mixed eval(object ob, string func, mixed *args)
        {
            return funcall(#'call_other, ob, func, args...);
        }

        and achieve the same result.

HISTORY
        Introduced in 3.2@70
        LDMud 3.2.8 adds the returning of a non-closure as first
        argument.
        LDMud 3.3 added the '...' operator and thus made apply() in fact
        redundant.
        LDMud 3.3.266 added support for structs.

SEE ALSO
        funcall(E), closures(LPC), varargs(LPC)