Adding functions - integer() missing?


#1

Hello,
I’m trying to add a new function to the C code, starting from the RISC-V version, but I have a problem with the integer conversion, because it seems integer() function is not available.
This is a part of my code:

object *fn_cblas_snrm2 (object *args, object *env) {
(void) env;
float fresult;
float temp;
int n = integer(first(args)); // array size
object *sx = second(args); // array
int incx = integer(third(args)); // increment

when I try to compile I have a note from the compiler:

ulisp-riscv_blas:3974:11: error: ‘integer’ was not declared in this scope
int n = integer(first(args)); // array size
^~~~~~~

is there a new definition for this function?

thanks,
Fausto


#2

Looking at fn_add, there’s no call to an integer() function, but the direct access to the integer value using -> operator.
So, if this is the proper method, I suppose the documentation should be updated.


#3

Yes, sorry about that. I’d been working on a new version of that page which fixed that error; integer() was an old version of checkinteger(). Here is the new page:

Adding your own functions


#4