Re: [Rd] :Re: PROTECT and OCaml GC.

From: Guillaume Yziquel <guillaume.yziquel_at_citycable.ch>
Date: Mon, 30 Nov 2009 18:30:30 +0100

Laurent Gautier a écrit :
>
> Anonymous R objects, that is without an associated symbol in R, can be
> passed to functions (and in that way makes a binding "take hold of R
> objects without using symbols").
> For example, building R code made of anonymous objects can be achieved
> by making a LANGSXP object and tweaking it.
>
> Example in R itself:
> > x <- call("round", 2.3)
> > eval(x)
> [1] 2
> > x[[1]] <- function(x) x^2
> > eval(x)
> [1] 5.29
>
> Getting more complex constructs may need a little more trickery.
>
> ...or do you mean something else ?
>
> L.

You're saying "anonymous R objects can be passed to functions". My question is:

can you construct a LANGSXP in C/Python/rpy from R objects and an anonymous R closure, the closure being available from C as a SEXP closure. Can you write a function

        SEXP my_langsxp (SEXP closure, SEXP arglist);

with only the API?

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon 30 Nov 2009 - 17:34:33 GMT

This archive was generated by hypermail 2.2.0 : Mon 30 Nov 2009 - 19:20:56 GMT