From luke-tierney at uiowa.edu  Tue May 16 16:40:19 2017
From: luke-tierney at uiowa.edu (luke-tierney at uiowa.edu)
Date: Tue, 16 May 2017 09:40:19 -0500 (CDT)
Subject: [Rd] stopifnot() does not stop at first non-TRUE argument
In-Reply-To: <495de2cf-1633-e3bf-8c61-5f30029399e6@insa-toulouse.fr>
References: <64acdaeb-2857-9017-68c9-9da08e29a617@fredhutch.org>
 <E5DADF15-58C6-4F73-BC56-C6404896982F@gmail.com>
 <c2b3cb22-90bd-5372-e8b9-d1ea8b2ab828@fredhutch.org>
 <8945f7e4-99ce-53fa-46ee-cce64078a6a8@fredhutch.org>
 <22809.26921.473223.395550@stat.math.ethz.ch>
 <8fdb66b1-f785-ed55-6e40-a4ef8138e637@insa-toulouse.fr>
 <26bd9210-e40c-0967-7abb-5f724b09c034@insa-toulouse.fr>
 <22809.44830.153073.675527@stat.math.ethz.ch>
 <477f9e1a-4f7c-a902-e744-da4a36eb5a4f@insa-toulouse.fr>
 <22809.52422.219712.66882@stat.math.ethz.ch>
 <alpine.LFD.2.20.1705151236510.27291@itasca.stat.uiowa.edu>
 <495de2cf-1633-e3bf-8c61-5f30029399e6@insa-toulouse.fr>
Message-ID: <alpine.DEB.2.20.1705160938100.3019@luke-Latitude>

On Tue, 16 May 2017, Serguei Sokol wrote:

> Le 15/05/2017 ? 19:41, luke-tierney at uiowa.edu a ?crit :
>> This is getting pretty convoluted.
>> 
>> The current behavior is consistent with the description at the top of
>> the help page -- it does not promise to stop evaluation once the first
>> non-TRUE is found.
> Hm... we can read in the man page :
> ?stopifnot(A, B)? is conceptually equivalent to
>
>      { if(any(is.na(A)) || !all(A)) stop(...);
>        if(any(is.na(B)) || !all(B)) stop(...) }
> and this behavior does promise to stop at first non-TRUE value
> without evaluation of the rest of conditions.

Yes: that is why I explicitly referenced the description at the top of
the page.

Changing the 'conceptually equivalent' bit to reflect what is
happening is easy.  The changes being discussed, and their long term
maintenance, ar not.

Best,

luke


>
> Sergue?.
>

-- 
Luke Tierney
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:   luke-tierney at uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu


[Rd] stopifnot() does not stop at first non-TRUE argument
luke-tierney at uiowa.edu