Previous: , Up: Positional Arguments Access   [Index]


9.5.4 Positional Arguments Visiting Functions

The variadic arguments of the visiting functions are passed by reference where possible. The aime function arguments are passed by reference where required and possible.

ucall

void ucall(object o, integer p, &...);

calls o for each argument of the calling aime function and with the unnamed arguments and the aime function argument inserted at the position p in between the unnamed arguments.

void
fx1(integer a, real b, text c)
{
    ucall(o_form, 1, " [~]");
}

The function ‘fx1’ prints each of its arguments, in between a leading [ and a trailing ].

qucall, ocall

void qucall(object o, integer p, integer f, integer l, &...);
void ocall(object o, integer p, integer f, integer l, &...);

call o for each of the f to l arguments of the calling aime function and with the unnamed arguments and the aime function argument inserted at the position p in between the unnamed arguments.

If l indicates an element prior to f the arguments starting with the f indexed one to the end of the list and those from the beginning of the list to the l indexed one are used (as if the list of arguments was circular).

void
fx2(real a, text b, real c, text d, real e, text f)
{
    ocall(o_form, 1, 0, 2, "[/w6/]");
    ocall(o_form, 1, 3, 5, "(/w6/)");
}

The function ‘fx2’ prints on minimum 6 bytes each of its first three arguments in between a leading [ and a trailing ] and each of its last three arguments in between a leading ( and a trailing ).

rucall

void rucall(object o, integer p, integer s, integer e, &...);

calls o for each argument of the calling aime function in the s to e section of its arguments list and with the unnamed arguments and the aime function argument inserted at the position p in between the unnamed arguments.

s and e are interpreted as insert positions, and may take positive values between 0 and n (and negative values between -n - 1 and -1, where n is the number of arguments for the calling aime function.

If s indicates a position prior to e the arguments after s to the end of the list and those from the beginning of the list to e are used (as if the list of arguments was circular).

void
fx3(real a, text b, real c, text d, real e, text f)
{
    rucall(o_form, 1, 0, 3, "[/w6/]");
    rucall(o_form, 1, 3, 6, "(/w6/)");
}

The function ‘fx3’ prints on minimum 6 bytes each of its first three arguments in between a leading [ and a trailing ] and each of its last three arguments in between a leading ( and a trailing ).


Previous: Positional Arguments Collecting Functions, Up: Positional Arguments Access   [Index]