Displaying 8 results from an estimated 8 matches for "defaultdeparse".
2023 May 06
1
Change DEFAULTDEPARSE to DEFAULTDEPARSE | SHOWATTRIBUTES ?
The deparse options used by default by 'deparse' and 'dput' are
c("keepNA", "keepInteger", "niceNames", "showAttributes")
but Defn.h still has
#define DEFAULTDEPARSE 1089 /* KEEPINTEGER | KEEPNA | NICE_NAMES, used for
calls */
i.e., with the SHOWATTRIBUTES bit turned off. Is that on purpose?
Note that this leads to weird things like:
> (expr <- call("is.matrix", matrix(1:4, 2L, 2L)))
is.matrix(1:4)
> eval(expr)
[1] TR...
2019 Jul 12
4
Unexpected behaviour when comparing (==) long quoted expressions
...rsed to character
strings before comparison.
and in the source code that does the comparison [1] shows that It
deparses each language object and then only extracts the first element
from the resulting character vector:
|SET_STRING_ELT(tmp, 0, (iS) ? PRINTNAME(x) : STRING_ELT(deparse1(x, 0,
DEFAULTDEPARSE), 0)); |
Is this a fix that needs to happen within the |==| documentation? or an
actual bug with the operator?
For more context the original issue we had is here:
https://github.com/rstudio-education/grader/issues/28
Workaround:
You can get around this issue by using |all.equal| or |identical...
2019 Jul 13
2
Mitigating Stalls Caused by Call Deparse on Error
...he traceback without deparsing the calls
+ */
?attribute_hidden
-SEXP R_GetTraceback(int skip)
+SEXP R_GetTracebackParsed(int skip)
?{
???? int nback = 0, ns;
???? RCNTXT *c;
@@ -1467,7 +1469,9 @@
??? ???? if (skip > 0)
??? ??? ?skip--;
??? ???? else {
-?? ??? ?SETCAR(t, deparse1m(c->call, 0, DEFAULTDEPARSE));
+??????????????? // Extra paranoid PROTECTS
+?? ??? ?SETCAR(t, PROTECT(duplicate(c->call)));
+??????????????? UNPROTECT(1);
??? ??? ?if (c->srcref && !isNull(c->srcref)) {
??? ??? ???? SEXP sref;
??? ??? ???? if (c->srcref == R_InBCInterpreter)
@@ -1482,7 +1486,26 @@
???? UNP...
2019 Jul 14
2
[External] Mitigating Stalls Caused by Call Deparse on Error
...ribute_hidden
> -SEXP R_GetTraceback(int skip)
> +SEXP R_GetTracebackParsed(int skip)
> ?{
> ???? int nback = 0, ns;
> ???? RCNTXT *c;
> @@ -1467,7 +1469,9 @@
> ??? ???? if (skip > 0)
> ??? ??? ?skip--;
> ??? ???? else {
> -?? ??? ?SETCAR(t, deparse1m(c->call, 0, DEFAULTDEPARSE));
> +??????????????? // Extra paranoid PROTECTS
> +?? ??? ?SETCAR(t, PROTECT(duplicate(c->call)));
> +??????????????? UNPROTECT(1);
> ??? ??? ?if (c->srcref && !isNull(c->srcref)) {
> ??? ??? ???? SEXP sref;
> ??? ??? ???? if (c->srcref == R_InBCInterpreter)
&...
2019 Jul 16
1
[External] Mitigating Stalls Caused by Call Deparse on Error
...etTracebackParsed(int skip)
>>> {
>>> int nback = 0, ns;
>>> RCNTXT *c;
>>> @@ -1467,7 +1469,9 @@
>>> if (skip > 0)
>>> skip--;
>>> else {
>>> - SETCAR(t, deparse1m(c->call, 0, DEFAULTDEPARSE));
>>> + // Extra paranoid PROTECTS
>>> + SETCAR(t, PROTECT(duplicate(c->call)));
>>> + UNPROTECT(1);
>>> if (c->srcref && !isNull(c->srcref)) {
>>> SEXP sref;
>>>...
2019 Jul 14
0
[External] Mitigating Stalls Caused by Call Deparse on Error
...ribute_hidden
> -SEXP R_GetTraceback(int skip)
> +SEXP R_GetTracebackParsed(int skip)
> ?{
> ???? int nback = 0, ns;
> ???? RCNTXT *c;
> @@ -1467,7 +1469,9 @@
> ??? ???? if (skip > 0)
> ??? ??? ?skip--;
> ??? ???? else {
> -?? ??? ?SETCAR(t, deparse1m(c->call, 0, DEFAULTDEPARSE));
> +??????????????? // Extra paranoid PROTECTS
> +?? ??? ?SETCAR(t, PROTECT(duplicate(c->call)));
> +??????????????? UNPROTECT(1);
> ??? ??? ?if (c->srcref && !isNull(c->srcref)) {
> ??? ??? ???? SEXP sref;
> ??? ??? ???? if (c->srcref == R_InBCInterpreter)
&...
2019 Jul 15
0
[External] Mitigating Stalls Caused by Call Deparse on Error
...ack(int skip)
>> +SEXP R_GetTracebackParsed(int skip)
>> ?{
>> ???? int nback = 0, ns;
>> ???? RCNTXT *c;
>> @@ -1467,7 +1469,9 @@
>> ??? ???? if (skip > 0)
>> ??? ??? ?skip--;
>> ??? ???? else {
>> -?? ??? ?SETCAR(t, deparse1m(c->call, 0, DEFAULTDEPARSE));
>> +??????????????? // Extra paranoid PROTECTS
>> +?? ??? ?SETCAR(t, PROTECT(duplicate(c->call)));
>> +??????????????? UNPROTECT(1);
>> ??? ??? ?if (c->srcref && !isNull(c->srcref)) {
>> ??? ??? ???? SEXP sref;
>> ??? ??? ???? if (c->srcref...
2019 Jul 16
0
Unexpected behaviour when comparing (==) long quoted expressions
...on.
> and in the source code that does the comparison [1] shows that It
> deparses each language object and then only extracts the first element
> from the resulting character vector:
> |SET_STRING_ELT(tmp, 0, (iS) ? PRINTNAME(x) : STRING_ELT(deparse1(x, 0,
> DEFAULTDEPARSE), 0)); |
> Is this a fix that needs to happen within the |==| documentation? or an
> actual bug with the operator?
This a good question.
Thank you, Daniel, for providing the link to the source code in
<R>/src/main/relop.c .
Looking at that and its context, I think we (R cor...