[inlinedocs] Problems with S4 method definitions

Toby Dylan Hocking Toby.Hocking at inria.fr
Fri Dec 16 13:38:17 CET 2011


Thanks for the code contribution, and the detailed analysis of the
problem. 

To answer your first question, as I recall, you are correct that
e=new.env() is a workaround to avoid the problems described in the
comments. I'm not sure what the best solution would be, but as long as
you find one that passes the checks it should be OK.

For your second question, I think the prefixed.lines Parser Function
was really meant for parsing the source of functions. For parsing new
kinds of comments like what you propose for S3 Methods, I suggest you
write a new Parser Function that looks for SetMethod() blocks and then
parses the comments out of them, returning an appropriate
documentation list. For additional information about writing Parser
Functions please see section 3 "the inlinedocs system of extensible
documentation generators." of the upcoming jss article, currently in
inlinedocs svn at inlinedocs/tex/jss/ --- you should be able to build
the pdf by typing "make" in that directory. I guess you should write a
Parser Function such as

s3method.comments <- function(code,...) {
 ## look for SetMethod() blocks, identify method name
 ## look for comments within
 ## create and return doc list
}


More information about the Inlinedocs-support mailing list