Next: , Up: Trap Library Samples   [Index]


7.25.3.1 Function Calling Examples

Call a function via ‘call’:

    call(max, 13, 19);

Store a function pointer with a data structure:

    record r;

    r_put(r, "f1", min);

and call it later:

    call(r_query(r, "f1"), 13, 19);

Non mandatory arguments are passed by reference where applicable:

    real u, v;

    u = call(modf, 2.5, v);

u’ and ‘v’ are set to .5 and 2, respectively.