[inlinedocs] new inline example ideas

Toby Dylan Hocking Toby.Hocking at inria.fr
Fri Apr 23 15:22:08 CEST 2010


ok, you bring up some interesting points.

1) I suppose it would be possible to have tests and examples that are
different for the same function, so it would be nice to have the
option to do examples inline right after the function definition, and
a tests separately in tests/fun.R. Then we could say
package.skeleton.dx(tests="write") to write test files if they don't
exist, and package.skeleton.dx(tests="overwrite") to overwrite
existing test files. And default of tests="dontwrite"

2) I don't think there should be any problem with library() calls in
example code. Already I add a suggests: line in my DESCRIPTION for
packages I use in examples. You don't? I don't think it hurts anything
to add a package to Suggests.

3) I don't think in memory images of example code is a problem.

4) Yes of course we will have to rework the parser for the ### return
value, but this will not be too difficult. We can just look for a ###
line after the return() line.

5) To keep the syntax simple I prefer to not have to explicitly start
the example with ##example<<, but you do bring up a valid point about
dontrun and dontshow, both of which I don't use very often. But I
think the whole point of inlinedocs is that everything should be
simple and transparent, so it WILL be run and it WILL be shown. I feel
OK not supporting dontrun and dontshow. Do you use these often? Will
it be a problem?


More information about the Inlinedocs-support mailing list