search for: prexpr

Displaying 7 results from an estimated 7 matches for "prexpr".

Did you mean: p_expr
2017 Apr 30
1
`match.call` and dots substitution
...at need to be substituted are language, they get substituted by `..n` where `n` is the position in dots. When they are scalars they are substituted with the scalar. It appears this is done in 'R-3.4.0:src/main/unique.c at 1319' in `subDots`: while (TYPEOF(t) == PROMSXP) t = PREXPR(t); if( isSymbol(t) || isLanguage(t) ) SETCAR(b, installDDVAL(i)); else SETCAR(b, t); I'm not sure why it is necessary to use `installDDVAL`, which creates the `..n` symbols, instead of duplicating the language object and attaching that to the matched call. Certainly from...
2014 Feb 11
1
getting environment from "top" promise
..., df=mtcars) dropLowMpg(b) Error in eval(expr, envir, enclos) (from #3) : object 'cutoff' not found We can fix this with a simple C function: SEXP top_prenv(SEXP nm, SEXP env) { SEXP promise = findVar(nm, env); while(TYPEOF(promise) == PROMSXP) { env = PRENV(promise); promise = PREXPR(promise); } return env; } With R wrapper: top_prenv <- function(x) { .Call2("top_prenv", substitute(x), parent.frame()) } Then this works (need to set subset,B again to reset cache): setMethod("subset", "A", function(x, subset) { env <- top_prenv(subse...
2015 Oct 30
0
match.call enhancements in 3.2.2
...c at 1228` (in 3.2.2 sources available as of today in CRAN).? Here is a snippet from that function: >??? for(a = dots, b = rval, i = 1; i <= len; a = CDR(a), b = CDR(b), i++) { >??? ??? SET_TAG(b, TAG(a)); >??? ??? t = CAR(a); >??? ??? while (TYPEOF(t) == PROMSXP) >??? ??? ??? t = PREXPR(t); >??? ??? if( isSymbol(t) || isLanguage(t) ) >??? ??? ??? SETCAR(b, installDDVAL(i));?? // <-- HERE >??? ??? else >??? ??? ??? SETCAR(b, t); >??? } The `installDDVAL(i)` generates the `..X` symbols.? I'm sure there is a very good reason why this is done, but then it does l...
2006 Mar 29
0
substitute() bug by you ? [forwarded]
...nto it. Duncan > > ---------------------------------------------------------------------------- > r37269 | murdoch | 2006-02-05 18:00:54 +0100 (Sun, 05 Feb 2006) | 7 lines > > Changes to substitute and findVar: > In C, substitute( , R_NilValue) does no substs, just > getting PREXPRs, while substitute( , R_GlobalEnv) does > substitutions. > > In R: substitute( , .GlobalEnv) is just like > R_NilValue above, as is substitute( , NULL). > ---------------------------------------------------------------------------- > > Regards, > Martin > > > -...
2002 Jan 02
1
Building R-1.4 on Tru64
...ymbol Rf_getAttrib Rf_length STRING_ELT R_CHAR R_do_slot Rf_asChar PRINTNAME Rf_isNull CAR CDR R_data_class Rf_isFunction Rf_findFun SETCAR Rf_eval INTEGER CLOENV Rf_findVarInFrame Rf_isSymbol ENCLOS SYMVALUE Rf_asLogical R_MissingArg Rf_isPrimitive do_set_prim_method BODY R_deferred_default_method PREXPR PRENV R_DotsSymbol DDVAL R_set_prim_method Rf_defineVar R_do_slot_assign mkdir ../../../../library/methods/libs make[5]: Leaving directory `/tmp_mnt/net/fire/s/fire/1/richardb/Tru64/src/library/methods/src' make[4]: Leaving directory `/tmp_mnt/net/fire/s/fire/1/richardb/Tru64/src/library/method...
2003 Oct 08
1
R-1.8.0 is released
...ector to be called by those writing extensions. (Note that the interface is changed from that used in the unexported header Parse.h in earlier versions, and is not guaranteed to remain unchanged.) o The header R_ext/Mathlib.h has been removed. It was replaced by Rmath.h in R 1.2.0. o PREXPR has been replaced by two macros, PREXPR for obtaining the expression and PRCODE for obtaining the code for use in eval. The macro BODY_EXPR has been added for use with closures. For a closure with a byte compiled body, the macro BODY_EXPR returns the expression that was compiled; if the body is...
2003 Oct 08
1
R-1.8.0 is released
...ector to be called by those writing extensions. (Note that the interface is changed from that used in the unexported header Parse.h in earlier versions, and is not guaranteed to remain unchanged.) o The header R_ext/Mathlib.h has been removed. It was replaced by Rmath.h in R 1.2.0. o PREXPR has been replaced by two macros, PREXPR for obtaining the expression and PRCODE for obtaining the code for use in eval. The macro BODY_EXPR has been added for use with closures. For a closure with a byte compiled body, the macro BODY_EXPR returns the expression that was compiled; if the body is...