Skip to content
Back to formatted view

Raw Message

Message-ID: <24851.29611.869540.598846@stat.math.ethz.ch>
Date: 2021-08-11T06:52:27Z
From: Martin Maechler
Subject: [R-pkg-devel] Workaround for code/documentation mismatch
In-Reply-To: <CAPcHnpS8EHAJ0ztwA_uEuBzSCi3TtmSdXz1Ak8+gCEwWMk61Hw@mail.gmail.com>

> Hello,
> 
> I've written two functions to emulate do while/until loops seen in other
> languages, but I'm having trouble documenting its usage. The function is
> typically used like:
> 
> do ({
>     expr1
>     expr2
>     ...
> }) %while% (cond)

I understand that you did *not* ask .. but really
why don't you want to use R's own
builtin, fast, well documented, present everywhere *and* simpler syntax

while(cond) {
  expr1
  expr2
  ...
}	

???

and also

   repeat {
     expr1
     expr2
     ....
     if(cond) break
   }

instead of your   %until%  below?


> so I want to document it something like:
> 
> do(expr) %while% (cond)
> do(expr) %until% (cond)
> 
> to look like the documentation for 'while' and 'if', but R CMD check
> produces a "Code/documentation mismatch" warning, complaining that the
> documentation should look like:
> 
> expr %while% cond
> expr %until% cond
> 
> So, my question is, is there a way to bypass the
> * checking for code/documentation mismatches
> portion of R CMD check, at least for one file? Some way to acknowledge that
> the code and documentation will mismatch, but that's okay.
> 
> 
> Thank you!