[Roxygen-devel] S4 implementation of @usage

Hadley Wickham hadley at rice.edu
Thu Aug 30 17:50:02 CEST 2012


> * Similarly, I still don't see how tags that operate globally would
> work. I think that's partly because the model is so focussed on the
> individual tag - the tag classes become very heavy - that's where all
> the logic is stored.  That's not such a good fit for actions that work
> on multiple tags in multiple rocblocks.  I wonder if we need a
> alternative model for some tags - instead of being stored in each
> rocblock, they should be stored globally:
>
> setClass("GlobalTag", contains = "Tag",
>   slots = "RocBlock" # pointer back to the rocblock that contained them
> )
> setClass("FamilyTag", contains = "GlobalTag")
> setClass("IncludeTag", contains = "GlobalTag")
> setClass("InheritParamsTag", contains = "GlobalTag")
>
> # Takes list of tags as input (not sure how dispatch would work) and
> rocBlocks as input
> # Returns list of rocblocks as output
> setGeneric("processGlobalTags")

Yet another option would make the Blocks (and Tags) into reference
objects so that they could be modified in place (this would also
remove the need for the explicit prerequisite tracking because the
tags could just parse themselves as needed). The big problem is that
it would be much much harder to cache (and that seems really important
for reasonable performance.

Hadley

-- 
Assistant Professor
Department of Statistics / Rice University
http://had.co.nz/


More information about the Roxygen-devel mailing list