[inlinedocs] Problems with S4 method definitions
Keith Ponting
k.ponting at aurix.com
Fri Dec 16 13:46:18 CET 2011
You might like to start by looking at extra.code.docs in parsers.R,
which already does something like this for setClass, although as the
comments say it is in need of refactoring as Toby suggests below.
Keith Ponting
Aurix Ltd, Malvern WR14 3SZ UK
> -----Original Message-----
> From: inlinedocs-support-bounces at r-forge.wu-wien.ac.at
> [mailto:inlinedocs-support-bounces at r-forge.wu-wien.ac.at] On Behalf Of
> Toby Dylan Hocking
> Sent: 16 December 2011 12:38
> To: markus.mueller.1.g at googlemail.com
> Cc: inlinedocs-support at r-forge.wu-wien.ac.at
> Subject: Re: [inlinedocs] Problems with S4 method definitions
>
> 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 } _______________________________________________
> Inlinedocs-support mailing list
> Inlinedocs-support at lists.r-forge.r-project.org
>
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/inlinedocs-
> support
More information about the Inlinedocs-support
mailing list