RE: Write Barrier: was: [Rd] function-like macros undefined

2005-03-16 Thread Prof Brian Ripley
On Wed, 16 Mar 2005, Vadim Ogranovich wrote: My actual problem was with the RAW() macro, it is not available as a function. I used INTEGER as an illustration because it was in the same group of macros, I guess I shouldn't have. It *is* available in R-devel, soon to be 2.1.0: the function was overl

RE: Write Barrier: was: [Rd] function-like macros undefined

2005-03-16 Thread Vadim Ogranovich
o the atomic vectors, should be done via macros/functions. Thanks, Vadim > -Original Message- > From: Luke Tierney [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 16, 2005 11:08 AM > To: Vadim Ogranovich > Cc: r-devel@stat.math.ethz.ch > Subject: Re: Write Barrier:

Re: Write Barrier: was: [Rd] function-like macros undefined

2005-03-16 Thread Luke Tierney
Your original question was about macro-like functions. INTEGER is available to internal R code as a macro; it is also available as a function. Code in packages that uses standard hearders will see the function, which is declared as int *(INTEGER)(SEXP x); I have no idea why you wanted to check wh

Re: Write Barrier: was: [Rd] function-like macros undefined

2005-03-16 Thread Simon Urbanek
On Mar 16, 2005, at 1:34 PM, Vadim Ogranovich wrote: * suppose that inside a C function I have a SEXP vector x of integers and I want to increment each element by one. I understand that Please correct me if I'm wrong, but I thought that the write barrier applies to assignments of SEXP values only

Write Barrier: was: [Rd] function-like macros undefined

2005-03-16 Thread Vadim Ogranovich
Hi, Thank you to Duncan Murdoch for pointing to http://www.stat.uiowa.edu/~luke/R/barrier.html. I have a couple of questions in this regard: * suppose that inside a C function I have a SEXP vector x of integers and I want to increment each element by one. I understand that int * xIPtr = INTEGER(

Re: [Rd] function-like macros undefined

2005-03-16 Thread Duncan Murdoch
On Tue, 15 Mar 2005 18:58:32 -0800, "Vadim Ogranovich" <[EMAIL PROTECTED]> wrote : >Hi, > >Somehow function-like macros from Rinternals.h are not defined when I >include the file. > >foo.c >## >#include >#include > > >#ifndef NILSXP >#error("NILSXP") >#endif > > >#ifndef INTE

[Rd] function-like macros undefined

2005-03-15 Thread Vadim Ogranovich
Hi, Somehow function-like macros from Rinternals.h are not defined when I include the file. foo.c ## #include #include #ifndef NILSXP #error("NILSXP") #endif #ifndef INTEGER #error("INTEGER") #endif ### When compiled: vor/src% gcc -I/usr/local/lib/R/in