Skip to content

Documenting classes and methods: was [Rd] Re: R-devel Digest, Vol 3, Issue 23

2 messages · Marsland, John, John Chambers

#
Might it be an idea to make "?" a special operator akin to "+" or "[", R
users could then write their own help functions - may be even making "?"
generic? With the proposed xml help system one could imagine quite
sophisticated context sensitive help systems.

Regards,

John Marsland

PS this has been a very useful debate for those of us enthusiastically using
S4 methods.
********************************************************************** 
This is a commercial communication from Commerzbank AG.\ \ This ... {{dropped}}
#
"Marsland, John" wrote:
In fact, "?" already is an infix operator ("grep '?' src/main/gram.y" to
see the grammar part of it).  Quite a bit of work has been done towards
making more general use of "?".  See help("?") for the general ideas. 
Class documentation is available this way:
  class ? numeric
  class ? MethodDefinition

For Version 1.8, there will very likely be some extensions.  These
require a bit of change to the "?" function itself to allow more general
expressions as arguments.  With that in place the current consensus (I
think) is to support expressions of the form:
  method ? f("numeric", "numeric")
to access method documentation for "f" corresponding to signature
c("numeric", "numeric"); and also of the form
  ?f(e1, e2)
for method documentation for the method selected corresponding to
expressions e1 and e2.
Indeed.  There's been some nice work done.  One important question may
be finding the right balance between taking advantage of the nicer model
provided by XML and being compatible with current R documentation.

John