This should work glitch free, providing the rest of your code has no bugs. Now, suppose you wish
to add a further three parameters to this function. If the DEFINE_PRIM helper function only caters for
functions accepting up to five parameters, how do you expose a function requiring more? The answer is
in a new helper function, DEFINE_PRIM_MULT .
DEFINE_PRIM_MULT( someFunc );
DEFINE_PRIM_MULT works in a similar fashion to DEFINE_PRIM , with the exception that it doesn ??™ t
require a value depicting the number of parameters required by the passed function. To facilitate this,
Chapter 20: Extending ha X e with C/C++
571
any function written to accept more than five values when called needs to utilize a different style of
signature. Instead of allowing an arbitrary number of parameters, the function should instead accept a
guaranteed two parameters: a pointer of type value , or value* , and a C/C++ integer. Here, the first
parameter represents an Array of values, and should be treated as such, while the second parameter
contains the number of values stored in the Array.
Pages:
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062