numeric: R_slong, R_double
string: R_string
These three registers are predefined variables of types corresponding to their namesakes. They are used for returning values from the built-in Yazoo functions, which are described in the next section.
The following built-in functions return their arguments to R_slong: top(), size(), find(), variable_type(), variable_member_top(), variable_code_top(),, member_type(), member_code_top(), member_indices(), member_ID(), if_member_targeted(), if_hidden_member(), variable_code_ID(), variable_code_offset(), member_code_ID() and member_code_offset().
R_double is used by the following built-in functions: abs(), round_down(), round_up(), log(), cos(), sin(), tan(), acos(), asin(), atan(), random(), and call().
The built-in functions that return values to R_string are: load(), input(), compile(), extract(), YZ_get_variable_code(), and YZ_get_member_code(). Note that compile() sets R_string but does not return R_string; the user must explicitly refer to R_string in order to access the compiled bytecode.
In practice (and with the exception of compile()), the user only rarely needs to deal explicitly with these primitive registers. For example, the code:
round_down(5.3)
result := R_double
is entirely equivalent to
result := round_down(5.3).
The second case is also better practice since it avoids storing the results in the registers any longer than is necessary. A primitive register is analogous to an explicit return variable within a user-defined function; it only stores the return value temporarily before handing it off to the calling function, and it can be completely invisible to the outside user.
Last update: July 28, 2013