Displaying 10 results from an estimated 10 matches for "cloenv".
Did you mean:
client
2016 May 20
2
identical on closures
...DY_EXPR, so why does the first example not
return TRUE as surely the formals and body are identical?
case CLOSXP:
return(R_compute_identical(FORMALS(x), FORMALS(y), flags) &&
R_compute_identical(BODY_EXPR(x), BODY_EXPR(y), flags) &&
(IGNORE_ENV || CLOENV(x) == CLOENV(y) ? TRUE : FALSE) &&
(IGNORE_BYTECODE || R_compute_identical(BODY(x), BODY(y),
flags))
);
R-3.2.4, Mac OS X El Capitan
Thanks
Mick Jordan
2020 Feb 26
1
Profiling: attributing costs to place of invocation (instead of place of evaluation)?
...t;sapply" "replicate" "f"
This attributes the cost to the replicate() call to f(), where the call
is actually defined. From my experience, this will give a much better
understanding of the actual costs of each part of the code. The SIGPROF
handler looks at sysparent and cloenv before deciding if an element of
the call stack is to be included in the profile.
Is there interest in integrating a variant of this patch, perhaps with
an optional argument to Rprof()?
Thanks!
Best regards
Kirill
Index: src/main/eval.c
=====================================================...
2003 Mar 26
0
Rprof/UseMethod
...around builtins and that can confuse things that
# don't take this into account. I unfortunately don't have time to
# track this properly now, but on a quick glance it looks like changing
cptr = R_GlobalContext;
if ( !(cptr->callflag & CTXT_FUNCTION) || cptr->cloenv != env)
error("UseMethod used in an inappropriate fashion");
#
# it two places in objects.c to
#
cptr = R_GlobalContext;
if (cptr->callflag == CTXT_BUILTIN)
cptr = cptr->nextcontext;
if ( !(cptr->callflag & CTXT_FUNCTION) || c...
2001 Sep 16
1
Using closures in libraries
...nts by the global environment. One way around
this would be to do the replacement only for closures that have the
same environment as the package environment. Basically change the
relevant lines in envir.c (do_libfixup) with -
while (p != R_NilValue) {
if (TYPEOF(CAR(p)) == CLOSXP && CLOENV(CAR(p)) != lib)
SET_CLOENV(CAR(p), env);
p = CDR(p);
}
In case any one wonders, I know I could wrap the function in a list
and call the function with foo[[1]]() - but it really does not look
very natural. Closures are often so useful that it is desirable that
they can be used from librarie...
2016 May 20
2
identical on closures
...gt; return TRUE as surely the formals and body are identical?
>>
>> case CLOSXP:
>> return(R_compute_identical(FORMALS(x), FORMALS(y), flags) &&
>> R_compute_identical(BODY_EXPR(x), BODY_EXPR(y), flags) &&
>> (IGNORE_ENV || CLOENV(x) == CLOENV(y) ? TRUE : FALSE) &&
>> (IGNORE_BYTECODE || R_compute_identical(BODY(x), BODY(y),
>> flags))
>> );
>>
>> R-3.2.4, Mac OS X El Capitan
>>
> Ok, I figured it out, but this is VERY unintuitive IMHO:
>
> > ident...
2002 Jul 19
1
Rprof and setMethod conflict?
I noticed this oddity about R profiling and setMethod.
First, I "test out" Rprof.
> require(methods)
Loading required package: methods
[1] TRUE
>
> Rprof("test.out")
> data.frame("a")
X.a.
1 a
> Rprof(NULL)
So far, so good. Next, I define myClass.
> setClass("myClass", representation(mySlot = "numeric"))
[1]
2009 Mar 03
1
profiler and loops
...t(RCNTXT * cptr, int flags,
SEXP syscall, SEXP env, SEXP sysp,
SEXP promargs, SEXP callfun)
{
cptr->nextcontext = R_GlobalContext;
cptr->cstacktop = R_PPStackTop;
cptr->evaldepth = R_EvalDepth;
cptr->callflag = flags;
cptr->call = syscall;
cptr->cloenv = env;
cptr->sysparent = sysp;
cptr->conexit = R_NilValue;
cptr->cend = NULL;
cptr->promargs = promargs;
cptr->callfun = callfun;
cptr->vmax = vmaxget();
cptr->intsusp = R_interrupts_suspended;
cptr->handlerstack = R_HandlerStack;
cptr->restarts...
2002 Jan 02
1
Building R-1.4 on Tru64
...set_quick_method_check
Rf_install
Rf_allocVector
LOGICAL
R_PreserveObject
Rf_mkChar
SET_STRING_ELT
Rf_findVar
R_UnboundValue
VECTOR_ELT
R_NamesSymbol
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/fi...
2009 Dec 16
2
What is the fastest way to see what are in an RData file?
Currently, I load the RData file then ls() and str(). But loading the file
takes too long if the file is big. Most of the time, I only interested what
the variables are in the the file and the attributes of the variables (like
if it is a data.frame, matrix, what are the colnames/rownames, etc.)
I'm wondering if there is any facility in R to help me avoid loading the
whole file.
2002 Jul 11
1
dyn.load tcl/tk (PR#1774)
...ar
Rf_asLogical
Rf_defineVar
Rf_eval
Rf_findVar
Rf_findVarInFrame
Rf_findFun
Rf_getAttrib
Rf_install
Rf_isEnvironment
Rf_isFunction
Rf_isNull
Rf_isObject
Rf_isPrimitive
Rf_isSymbol
Rf_length
Rf_mkChar
ATTRIB
R_CHAR
STRING_ELT
SET_STRING_ELT
VECTOR_ELT
LOGICAL
INTEGER
TAG
CAR
CDR
MISSING
SETCAR
BODY
CLOENV
PRINTNAME
SYMVALUE
DDVAL
FRAME
ENCLOS
Rf_type2str
R_PreserveObject
R_set_standardGeneric_ptr
R_data_class
R_deferred_default_method
R_set_prim_method
do_set_prim_method
R_set_quick_method_check
R_do_slot
R_do_slot_assign
mkdir -p -- ../../../../library/methods/libs
gmake[5]: Leaving directory `/sof...