Skip to content

PROTECT and OCaml GC.

3 messages · Guillaume Yziquel, Simon Urbanek

#
Simon Urbanek a ?crit :
Reading R-exts,

-1- I believe it would be a good idea to put an example with CONS and 
LCONS in section 5.11.

-2- Building a LANGSXP list with tags from arguments needs invocations 
of CONS LCONS SET_TAG and install. While this is not exactly to my 
taste, using install is really not to my taste since it checks the 
symbol table and eventually creates a symbol. Isn't there a way to 
create a tag without using install over and over? A macro that simply 
sets the tag to whatever CHARSXP might be useful?
#
On Dec 1, 2009, at 8:32 PM, Guillaume Yziquel wrote:

            
No, because you cannot use CHARSXP as a TAG. TAGs are always symbols. Therefore, logically, you must register it first in (or obtain from) the symbol table using install.

Cheers,
Simon
#
Simon Urbanek a ?crit :
OK. That's R side.

OCaml side, I need to have as little side-effects as possible. Symbol 
assignment is a side-effect.

Is there an API-compliant way to handle this, and make data structures 
as immutable as possible?