Next: , Previous: , Up: Positional Arguments Access   [Index]


9.5.3 Positional Arguments Collecting Functions

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

xcall

object xcall(object o, &...);

is the evaluation result of the function indicated by o called with all the remaining arguments of xcall and all the arguments of the aime function featuring the call.

void
fx1(integer a)
{
    xcall(o_bfxinteger, 8, 32, 2);
}

The function ‘fx1’ prints a in base 2 with 32 digits grouped in comma separated blocks of 8 digits.

qxcall, rcall

object qxcall(object o, integer p, integer f, integer l, &...);
object rcall(object o, integer p, integer f, integer l, &...);

are the evaluation result of the function indicated by o called with the unnamed arguments and the f to l arguments of the aime function featuring the call 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(integer a, integer b, integer c, integer d)
{
    rcall(o_form, 1, 1, 2, "~ ~\n");
    rcall(o_form, 1, 3, 0, "~ ~\n");
}

The function ‘fx2’ prints b and c on the first line and d and a on the second.

rxcall

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

is the evaluation result of the function indicated by o called with the unnamed arguments and the s to e section of the arguments list of the aime function featuring the call 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(integer a, integer b, integer c, integer d)
{
    rxcall(o_form, 1, 1, 3, "~ ~\n");
    rxcall(o_form, 1, 3, 1, "~ ~\n");
}

The function ‘fx3’ prints b and c on the first line and d and a on the second.

lcall

object lcall(object o, integer r, &...);

is the evaluation result of the function indicated by o called with ranges of arguments of the aime function featuring the call and the arguments of the call following range indications. r is the number of subsequent range indications, each expected a triplet of intrinsic integers: an insertion position and the indeces of the first and last arguments to be copied.

The aime function argument ranges are inserted in the list of used lcall arguments (i.e. the arguments following the range indications) and insertion positions are interpreted with respect to the latter. If more ranges are to be inserted at the same position, they are inserted in the order in which they appear.

If the last argument index in a range specification indicates an element prior to the first argument index, the arguments starting with the one indexed first to the end of the list and those from the beginning of the list to the one indexed last are used (as if the list of arguments was circular).

Negative insertion positions and argument indeces are interpreted with respect to the end of the relevant list.

void
fx4(integer a, b, c, d, e, f, g, h, i)
{
    lcall(o_plan, 4, 0, 0, 1, 2, 3, 5, 4, 6, 8, 0, 2, 2, "a", "b", "c", "d");
}

The function ‘fx4’ prints the sequence a, b, c, d, with the first three argument preceding the first letter, the middle three arguments in between the second and the third letter and the last three arguments following the last letter.


Next: Positional Arguments Visiting Functions, Previous: Positional Arguments Accessor Operators, Up: Positional Arguments Access   [Index]