Displaying 20 results from an estimated 3000 matches similar to: "Compiler + stopifnot bug"
2019 Jan 04
2
Compiler + stopifnot bug
On 03/01/2019 3:37 p.m., Duncan Murdoch wrote:
> I see this too; by bisection, it seems to have first appeared in r72943.
Sorry, that was a typo. I meant r75943.
Duncan Murdoch
>
> Duncan Murdoch
>
> On 03/01/2019 2:18 p.m., I?aki Ucar wrote:
>> Hi,
>>
>> I found the following issue in r-devel (2019-01-02 r75945):
>>
>> `foo<-` <-
2019 Jan 04
2
Compiler + stopifnot bug
Thanks for the reports. Will look into it soon and report back.
Luke
Sent from my iPhone
> On Jan 3, 2019, at 2:15 PM, Martin Morgan <mtmorgan.bioc at gmail.com> wrote:
>
> For what it's worth this also introduced
>
>> df = data.frame(v = package_version("1.2"))
>> rbind(df, df)$v
> [[1]]
> [1] 1 2
>
> [[2]]
> [1] 1 2
2019 Jan 04
0
Compiler + stopifnot bug
For what it's worth this also introduced
> df = data.frame(v = package_version("1.2"))
> rbind(df, df)$v
[[1]]
[1] 1 2
[[2]]
[1] 1 2
instead of
> rbind(df, df)$v
[1] '1.2' '1.2'
which shows up in Travis builds of Bioconductor packages
https://stat.ethz.ch/pipermail/bioc-devel/2019-January/014506.html
and elsewhere
2019 Jan 04
0
Compiler + stopifnot bug
Should be fixed in r75946.
Best,
luke
On Fri, 4 Jan 2019, Tierney, Luke wrote:
> Thanks for the reports. Will look into it soon and report back.
>
> Luke
>
> Sent from my iPhone
>
>> On Jan 3, 2019, at 2:15 PM, Martin Morgan <mtmorgan.bioc at gmail.com> wrote:
>>
>> For what it's worth this also introduced
>>
>>> df = data.frame(v =
2019 Mar 31
3
stopifnot
Ah, with R 3.5.0 or R 3.4.2, but not with R 3.3.1, 'eval' inside 'for' makes compiled version behave like non-compiled version.
options(error = expression(NULL))
library(compiler)
enableJIT(0)
f <- function(x) for (i in 1) {x; eval(expression(i))}
f(is.numeric(y))
# Error: object 'y' not found
fc <- cmpfun(f)
fc(is.numeric(y))
# Error: object 'y' not found
2019 Apr 01
1
[External] Re: stopifnot -- eval(*) inside for()
On Mon, 1 Apr 2019, Martin Maechler wrote:
>>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>>> on Sun, 31 Mar 2019 15:26:13 +0000 writes:
>
> > Ah, with R 3.5.0 or R 3.4.2, but not with R 3.3.1, 'eval'
> > inside 'for' makes compiled version behave like
> > non-compiled version.
>
> Ah.. ... thank
2019 Apr 03
0
stopifnot -- eval(*) inside for()
With
f <- function(x) for (i in 1) x
fc <- cmpfun(f)
(my previous example), error message of
fc(is.numeric(y))
shows the originating call as well, while error message of
f(is.numeric(y))
doesn't. Compiled version behaves differently.
Even with
f <- function(x) for (i in 1) {x; eval(expression(i))}
fc <- cmpfun(f)
, error message of
fc(is.numeric(y))
shows the originating call in R
2019 Apr 01
0
stopifnot -- eval(*) inside for()
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>> on Sun, 31 Mar 2019 15:26:13 +0000 writes:
> Ah, with R 3.5.0 or R 3.4.2, but not with R 3.3.1, 'eval'
> inside 'for' makes compiled version behave like
> non-compiled version.
Ah.. ... thank you for detecting that " eval() inside for()" behaves
specially
2019 Mar 07
0
stopifnot
By not using 'withCallingHandler' or 'tryCatch', the state is like 'stopifnot' in R 3.4.x. If 'stopifnot' becomes faster than in R 3.4.x when the expressions given to 'stopifnot' are all TRUE, it is because 'match.call' is not called. Credit is to https://github.com/HenrikBengtsson/Wishlist-for-R/issues/70 for the idea.
Speaking about
2006 Mar 01
1
stopifnot() suggestion
If an expression is passed to stopifnot() which contains missing values,
then the resulting error message is somewhat baffling until you are used
to it, e.g.
> x <- y <- rep(TRUE, 10)
> y[7] <- NA
> stopifnot(x, y)
Error in if (!(is.logical(r <- eval(ll[[i]])) && all(r)))
stop(paste(deparse(mc[[i + :
missing value where TRUE/FALSE needed
A minor change to
2019 Feb 24
1
stopifnot
>From https://github.com/HenrikBengtsson/Wishlist-for-R/issues/70 :
... and follow up note from 2018-03-15: Ouch... in R-devel, stopifnot() has become yet 4-5 times slower;
...
which is due to a complete rewrite using tryCatch() and withCallingHandlers().
>From https://stat.ethz.ch/pipermail/r-devel/2017-May/074256.html , it seems that 'tryCatch' was used to avoid the following
2017 May 15
3
stopifnot() does not stop at first non-TRUE argument
I think Herv?'s idea was just that if switch can evaluate arguments selectively, so can stopifnot(). But switch() is .Primitive, so does it from C.
I think it is almost a no-brainer to implement a sequential stopifnot if dropping to C code is allowed. In R it gets trickier, but how about this:
Stopifnot <- function(...)
{
n <- length(match.call()) - 1
for (i in 1:n)
{
nm
2019 May 30
2
stopifnot
Here is a patch to function 'stopifnot' that adds 'evaluated' argument and makes 'exprs' argument in 'stopifnot' like 'exprs' argument in 'withAutoprint'.
--- stop.R 2019-05-30 14:01:15.282197286 +0000
+++ stop_new.R 2019-05-30 14:01:51.372187466 +0000
@@ -31,7 +31,7 @@
.Internal(stop(call., .makeMessage(..., domain = domain)))
}
2018 Mar 12
0
Bug report: override stopifnot() ?
Why don't you use
stopifnot( all(m1 == m2) )
?
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Mar 12, 2018 at 8:15 AM, Stepan Kasal <kasal at ucw.cz> wrote:
> Hello,
> I stumbled over a problem:
> stopifnot(m1 == m2)
>
> It works with vector or matrix, but does not work for classes from Matrix
> package.
>
> In the source of stopifnot(), there is
2017 May 16
3
stopifnot() does not stop at first non-TRUE argument
switch(i, ...)
extracts 'i'-th argument in '...'. It is like
eval(as.name(paste0("..", i))) .
Just mentioning other things:
- For 'n',
n <- nargs()
can be used.
- sys.call() can be used in place of match.call() .
---------------------------
>>>>> peter dalgaard <pdalgd at gmail.com>
>>>>> on Mon, 15 May 2017 16:28:42
2018 Mar 12
2
Bug report: override stopifnot() ?
Hello,
I stumbled over a problem:
stopifnot(m1 == m2)
It works with vector or matrix, but does not work for classes from Matrix package.
In the source of stopifnot(), there is all(m1 == m2) that would just work,
but there is also is.logical(m1 == m2) that id FALSE.
Would it be possible if Matrix package redefined stopifnot() ?
(If there is a bug tracking database for package Matrix, I would
2017 May 03
2
stopifnot() does not stop at first non-TRUE argument
Hi,
It's surprising that stopifnot() keeps evaluating its arguments after
it reaches the first one that is not TRUE:
> stopifnot(3 == 5, as.integer(2^32), a <- 12)
Error: 3 == 5 is not TRUE
In addition: Warning message:
In stopifnot(3 == 5, as.integer(2^32), a <- 12) :
NAs introduced by coercion to integer range
> a
[1] 12
The details section in its man
2018 Mar 12
0
Bug report: override stopifnot() ?
Please stop this line of queries/"suggestions/speculations and read the
relevant docs **carefully**.
For example, from ?"=="
"Note
Do not use == and != for tests, such as in if expressions, where you must
get a single TRUE or FALSE. Unless you are absolutely sure that nothing
unusual can happen, you should use the identical
2017 May 19
1
stopifnot() does not stop at first non-TRUE argument
While you are fiddling with stopifnot(), please consider changing the form
of the error thrown so that it includes the caller's call. The change
would be from something like
stop( <<the message>> )
to
stop(simpleError( <<the message>>, sys.call(-1)))
For the following code
f <- function(x, y) {
stopifnot(x > y)
x - y
}
g <- function(x,
2017 May 03
2
stopifnot() does not stop at first non-TRUE argument
Not sure why the performance penalty of nonstandard evaluation would
be more of a concern here than for something like switch().
If that can't/won't be fixed, what about fixing the man page so it's
in sync with the current behavior?
Thanks,
H.
On 05/03/2017 02:26 AM, peter dalgaard wrote:
> The first line of stopifnot is
>
> n <- length(ll <- list(...))
>
>