[R] First R package, advice
ivo.welch at gmail.com
Sun Feb 10 02:26:24 CET 2013
I am still researching my best choices.
IMHO, every programming and every typesetting language ever invented
should have had a compatible basic escape sequence built in. simple.
just compatible with one another. something like a specific escape
sequence on the first column, like
means that now an R segment starts.
means that now a LaTeX segment starts. (markdown and html are other
good text language choices. for programming, markdown or markup would
usually make most sense.)
maybe '#if' would have been better. it is escaped in many languages,
except TeX and C, of course. or '//R'. or '%%R'. whatever. IF ONLY
every language had used '#' as its comment character, it would have
been a good start.
the source could then be run through any compiler or typesetter and
every one would know what is meant for it. if no such escapes are in
the source, then the executable would assume it owns the whole source.
any compiles should/could decide to ignore sections not meant for it.
importantly, your favorite editor or ide would know how to highlight
right now, the world is a mess. perl escapes from perl to docs with
=POD commands; doxygen2 escapes from R to docs with #' commands on
every line; latex escapes with \verb+ commands, well sort of. html
escapes with <pre> commands, but what is in between must not contain
certain sequences. C escapes with '#if 0'.
there is really a benefit to standardization here, but the world's
standardization bodies are too unstandardized to make this feasible.
so I am contemplating---do I want R code that can be processed to spit
out some latex, or latex code that can be processed to spit out some
R, or my own code that can become both latex and R?
I could live with rolling my own IF ONLY my ide/editor would
understand my new format. I do not have the skills to tell emacs how
to switch syntax-highlighting in the middle of files.
this collective path-dependence will plague us for decades, having
created a cost without a benefit.
Ivo Welch (ivo.welch at gmail.com)
More information about the R-help