[Rd] vctrs: a type system for the tidyverse
jan Vitek
vitekj @ending from icloud@com
Thu Aug 9 23:25:01 CEST 2018
> I'm now confident that I
> can avoid using "type" by itself, and instead always use it in a
> compound phrase (like type system) to avoid confusion. That leaves the
> `.type` argument to many vctrs functions. I'm considering change it to
> .prototype, because what you actually give it is a zero-length vector
> of the class you want, i.e. a prototype of the desired output. What do
> you think of prototype as a name?
The term “type system” in computer science is used in very different ways.
What the note describes is not a type system, but rather a set of
coercions used by a small number of functions in one package.
Typically it refers to a set of rules (either statically enforced
by the compiler or dynamically enforced by the runtime) that ensure
that some particular category of errors can be caught by the
language.
There is none of that here.
My suggestion would be to avoid “type system”.
"The short-term goal of vctrs is to develop a type system for vectors which will help reason about functions that combine different types of input (e.g. c(), ifelse(), rbind()). The vctrs type system encompasses base vectors (e.g. logical, numeric, character, list), S3 vectors (e.g. factor, ordered, Date, POSIXct), and data frames; and can be extended to deal with S3 vectors defined in other packages, as described in vignette("extending-vctrs”).”
==>
The short-term goal of vctrs is to specify the behavior of functions that combine different types of vectors (e.g. c(), ifelse(), rbind()). The specification encompasses base vectors (e.g. logical, numeric, character, list), S3 vectors (e.g. factor, ordered, Date, POSIXct), and data frames; and can be extended to deal with S3 vectors defined in other packages, as described in vignette("extending-vctrs”).
and so on.
-j
More information about the R-devel
mailing list