32 Promise_Impl( SEXP x){
33 if( TYPEOF(x) != PROMSXP) {
34 const char* fmt =
"Not a promise: [type = %s].";
35 throw not_compatible(fmt, Rf_type2char(TYPEOF(x)));
45 return PRSEEN(Storage::get__());
52 if (!was_evaluated())
throw unevaluated_promise();
53 return PRVALUE(Storage::get__());
56 bool was_evaluated()
const {
57#if R_VERSION < R_Version(4,6,0)
58 return PRVALUE(Storage::get__()) != R_UnboundValue ;
60 SEXP env = environment();
61 R_BindingType_t bt = R_GetBindingType(Storage::get__(), env);
62 return bt != R_BindingTypeUnbound;
80 inline void update(SEXP data){}