Commit ebd53035 authored by Radford Neal's avatar Radford Neal

pass on gradient request to function via promises

parent 2452ad64
......@@ -1568,9 +1568,9 @@ void PrintWarnings(void);
void process_site_Renviron(void);
void process_system_Renviron(void);
void process_user_Renviron(void);
SEXP promiseArgs(SEXP, SEXP);
SEXP promiseArgs(SEXP, SEXP, int);
SEXP promiseArgsWithValues(SEXP, SEXP, SEXP);
SEXP promiseArgsWith1Value(SEXP, SEXP, SEXP);
SEXP promiseArgsWith1Value(SEXP, SEXP, SEXP, int);
void Rcons_vprintf(const char *, va_list);
SEXP RemoveVariable(SEXP, SEXP);
SEXP R_data_class(SEXP , Rboolean);
......@@ -240,7 +240,8 @@ struct sxpinfo_struct {
unsigned int rstep_pname : 1; /* Function: is to be debugged just once
Symbol: subassign counterpart follows it
CHARSXP: is used as a symbol's printname
Envir: store gradient with variables */
Envir: store gradient with variables
Promise: evaluate with VARIANT_GRADIENT */
unsigned int base_sym_env : 1;/* Symbol: has base binding in global cache,
Envir: R_BaseEnv or R_BaseNamespace*/
......@@ -963,7 +963,7 @@ static SEXP do_bind(SEXP call, SEXP op, SEXP args, SEXP env)
* drop through to the default code.
PROTECT(args = promiseArgs(args, env));
PROTECT(args = promiseArgs(args, env, 0));
generic = ((PRIMVAL(op) == 1) ? "cbind" : "rbind");
klass = "";
......@@ -1045,7 +1045,7 @@ static int tryDispatch(char *generic, SEXP call, SEXP x, SEXP rho, SEXP *pv)
int dispatched = FALSE;
SEXP op = SYMVALUE(install(generic)); /**** avoid this */
PROTECT(pargs = promiseArgsWith1Value(CDR(call), rho, x));
PROTECT(pargs = promiseArgsWith1Value(CDR(call), rho, x, 0));
/**** Minimal hack to try to handle the S4 case. If we do the check
and do not dispatch then some arguments beyond the first might
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment