Hi Thorsten,
> Question on topic 2:
> given the C data type described below for an R "node", would it be somehow
> possible to extract just the SEXPTYPE from a SEXP return value, i.e.
> the first field of the sexpinfo_struct, that is the first struct in the
> SEXPREC_
:
>
>> Hi Alex,
>> after digging deeper in R Internals I found out that there are actually C
>> access functions for the various subtypes of SEXP that can be wrapped with
>> native too:
>>
>> rinc: (setupRinC)
>> -> NIL
>> rinc: (evalQuietlyInR &
ging deeper in R Internals I found out that there are actually C
> access functions for the various subtypes of SEXP that can be wrapped with
> native too:
>
> rinc: (setupRinC)
> -> NIL
> rinc: (evalQuietlyInR "V <- c(1.5, 3.4, 4.2)")
> -> NIL
> rinc: (evalIn
Hi Alex,
after digging deeper in R Internals I found out that there are actually C
access functions for the various subtypes of SEXP that can be wrapped with
native too:
rinc: (setupRinC)
-> NIL
rinc: (evalQuietlyInR "V <- c(1.5, 3.4, 4.2)")
-> NIL
rinc: (evalInR "V&q
On Wed, Apr 07, 2021 at 07:46:20AM +0200, Alexander Burger wrote:
> OK, so now we have a pointer to a structure filled by evalInR().
> ...
>(struct (evalInR "6*4") ...)
In fact this depends on what exactly evalInR() returns.
If it returns a pointer to a dynamically allocated structure, and
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 b
M Thorsten Jolitz wrote:
>
>> Hello List,
>> I wonder how to deal with the R SEXP Data structure in native calls.
>>
>> *"Technically, [a SEXP] is a pointer to a structure with typedef SEXPREC
Hi Alex,
thanks for the hints, I tried both, T and 'P as result values , the first
gives a segment fault, but the second actually works:
(de evalInR ("Cmd")
(native `*RinC "evalInR" 'P "Cmd"))
## SEXP evalInR(char * cmd);
rinc: (evalInR "print(6*4)&qu
available through the API, in case of R a process similar to FFI using as
reference the include files, wouldn't?
HTH
--
Cesar Rabak
On Mon, Apr 5, 2021 at 4:30 PM Thorsten Jolitz wrote:
> Hello List,
> I wonder how to deal with the R SEXP Data structure in native calls.
>
>
Hi Thorsten,
> I wonder how to deal with the R SEXP Data structure in native calls.
>
> *"Technically, [a SEXP] is a pointer to a structure with typedef SEXPREC.
> A SEXP is a variant type, with subtypes for all R’s data structures"*
>
> E.g.
>
>- IN
Hello List,
I wonder how to deal with the R SEXP Data structure in native calls.
*"Technically, [a SEXP] is a pointer to a structure with typedef SEXPREC.
A SEXP is a variant type, with subtypes for all R’s data structures"*
E.g.
- INTSXP: integer vector
- LGLSXP: logi
Alexander Burger a...@software-lab.de writes:
Hi Alex,
I wonder if there is a way in PicoLisp to check if some function
argument is a SEXP, i.e. if something like a function 'sexp? exists that
returns T if the argument is a SEXP.
I'm a bit puzzled by this question. To my understanding
Hi Thorsten,
I'm a bit puzzled by this question. To my understanding, every possible
expression in PicoLisp is a SEXP. Even auto-quoting expressions like
...
.. and was a bit confused when asking, I probably meant 'list' instead of
SEXP.
...
then invalid file names fall into category
On Monday 01 of July 2013 07:39:49 you wrote:
Hi Thorsten,
I wonder if there is a way in PicoLisp to check if some function
argument is a SEXP, i.e. if something like a function 'sexp? exists that
returns T if the argument is a SEXP.
how about (pair 'any) ? basically the opposite
dexen deVries dexen.devr...@gmail.com
writes:
On Monday 01 of July 2013 07:39:49 you wrote:
Hi Thorsten,
I wonder if there is a way in PicoLisp to check if some function
argument is a SEXP, i.e. if something like a function 'sexp? exists that
returns T if the argument is a SEXP.
how
function
argument is a SEXP, i.e. if something like a function 'sexp? exists
that
returns T if the argument is a SEXP.
how about (pair 'any) ? basically the opposite of (atom 'any)
thats probably what I was looking for, thanks, besides the fact that
Alex is of course right about
to check if some function
argument is a SEXP, i.e. if something like a function 'sexp? exists
that
returns T if the argument is a SEXP.
how about (pair 'any) ? basically the opposite of (atom 'any)
thats probably what I was looking for, thanks
Hi List,
I wonder if there is a way in PicoLisp to check if some function
argument is a SEXP, i.e. if something like a function 'sexp? exists that
returns T if the argument is a SEXP.
To complicate things a bit, I would actually need to check in PicoLisp
if the argument given is an Emacs Lisp
18 matches
Mail list logo