Hi Thorsten,

>  (de evalInR ("Cmd")
>       (native `*RinC "evalInR" 'P "Cmd"))
> 
> ##  SEXP evalInR(char * cmd);
> 
> rinc: (evalInR "print(6*4)")
> [1] 24
> -> 65814160

OK, so now we have a pointer to a structure filled by evalInR().


> rinc: (evalInR "6*4")
> -> 65814160
> 
> how can I extract the result from that Pointer in PicoLisp (lack of C
> skills ... ;-)?

You can use the 'struct' function to access it.

I could not find the exact definition of SEXP. but as it is a pointer to a
structure, you can do

   (struct (evalInR "6*4") ...)

The arguments depend on the exact layout of the data in the C struct. I think
this helps: https://software-lab.de/doc/native.html

☺/ A!ex


-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to