Re: [Rd] longint

2018-08-15 Thread William Dunlap via R-devel
Note that include/S.h contains /* This is a legacy header and no longer documented. Code using it should be converted to use R.h */ ... /* is this a good idea? - conflicts with many versions of f2c.h */ # define longint int S.h was meant to be used while converting to R C code

Re: [Rd] longint

2018-08-15 Thread Benjamin Tyner
Thanks for the replies and for confirming my suspicion. Interestingly, src/include/S.h uses a trick:    #define longint int and so does the nlme package (within src/init.c). On 08/15/2018 02:47 PM, Hervé Pagès wrote: No segfault but a BIG warning from the compiler. That's because dereferencin

Re: [Rd] longint

2018-08-15 Thread Hervé Pagès
No segfault but a BIG warning from the compiler. That's because dereferencing the pointer inside your myfunc() function will produce an int that is not predictable i.e. it is system-dependent. Its value will depend on sizeof(long int) (which is not guaranteed to be 8) and on the endianness of the

Re: [Rd] validspamobject?

2018-08-15 Thread William Dunlap via R-devel
That was my first thought (my second was trace(.Deprecated,...)). However, the spam authors don't use .Deprecated() or warning() to tell about deprecated functions. See spam/R/deprecated.R: validspamobject <- function( ...) { #.Deprecated('validate_spam()') message("`validspamobject()` i

Re: [Rd] longint

2018-08-15 Thread Brian Ripley
> On 15 Aug 2018, at 12:48, Duncan Murdoch wrote: > >> On 15/08/2018 7:08 AM, Benjamin Tyner wrote: >> Hi >> In my R package, imagine I have a C function defined: >> void myfunc(int *x) { >>// some code >> } >> but when I call it, I pass it a pointer to a longint instead of a >

Re: [Rd] substitute() on arguments in ellipsis ("dot dot dot")?

2018-08-15 Thread Jim Hester
Assuming you are fine with a pairlist instead of a list avoiding the `as.list()` call for dots2 saves a reasonable amount of time and makes it clearly the fastest. library(rlang) dots1 <- function(...) as.list(substitute(list(...)))[-1L] dots2 <- function(...) as.list(substitute(...())) dots2.5 <

Re: [Rd] longint

2018-08-15 Thread Duncan Murdoch
On 15/08/2018 7:08 AM, Benjamin Tyner wrote: Hi In my R package, imagine I have a C function defined:    void myfunc(int *x) {   // some code    } but when I call it, I pass it a pointer to a longint instead of a pointer to an int. Could this practice potentially result in a segfault

[Rd] longint

2018-08-15 Thread Benjamin Tyner
Hi In my R package, imagine I have a C function defined:    void myfunc(int *x) {   // some code    } but when I call it, I pass it a pointer to a longint instead of a pointer to an int. Could this practice potentially result in a segfault? Regards Ben __

Re: [Rd] validspamobject?

2018-08-15 Thread Emil Bode
Hello, If you want to determine where the warning is generated, I think it's easiest to run R with options(warn=2). In that case all warnings are converted to errors, and you have more debugging tools, e.g. you can run traceback() to see the calling stack, or use options(error=recover). Hope yo

Re: [Rd] substitute() on arguments in ellipsis ("dot dot dot")?

2018-08-15 Thread lmo via R-devel
A potential solution, at least in terms of producing the desired output, is the base R function alist: > alist(1+2, "a", rnorm(3)) [[1]] 1 + 2 [[2]] [1] "a" [[3]] rnorm(3) > str(alist(1+2, "a", rnorm(3))) List of 3  $ : language 1 + 2  $ : chr "a"  $ : language rnorm(3) luke [[altern