[Rd] Declaring Types at Function Declaration
ivo welch
|vo@we|ch @end|ng |rom uc|@@edu
Wed Nov 26 17:59:04 CET 2025
I am more interested why something like this has not made its way into R
core as a first step to type checking *for everyone*. (I could imagine
that an option would turn on and off some automatic stopifnot like checking
given a standardized annotation form [type, dim].)
is it because there is not much wider interest and desirability (so even a
basic working implementation would not be pulled into R by the powers that
are in charge), or is it because the work is too difficult and no one had
time to work on it?
On Wed, Nov 26, 2025 at 8:50 AM Hadley Wickham <h.wickham using gmail.com> wrote:
> You might be interested in Jim Hester’s old experiment that used ? -
> https://github.com/jimhester/types
>
> Hadley
>
> On Wednesday, September 17, 2025, IVO I WELCH <iwelch using g.ucla.edu> wrote:
>
>>
>> Suggestion for Syntax Sugar:
>>
>> Would it make sense to permit a simple way to allow a coder to document
>> the function argument type?
>>
>> f <- function( a:chr, b:data.frame, c:logi ) { … }
>>
>> presumably, what comes behind the ‘:’ should match what ‘str’ returns.
>>
>> however, this need not be checked (except perhaps when a particular
>> option is set). catching errors as soon as possible makes code easier to
>> debug and error messages clearer.
>>
>> regards,
>>
>> /iaw
>>
>> ______________________________________________
>> R-devel using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>
> --
> http://hadley.nz
>
[[alternative HTML version deleted]]
More information about the R-devel
mailing list