[R] Code completion

Duncan Murdoch dmurdoch at pair.com
Sat Feb 17 18:35:07 CET 2001

On Sat, 17 Feb 2001 19:50:24 +1100, you wrote:

>Some form of "code completion" might be of assistance to users like me .. 

I'm also a Delphi user, and I agree that what you're asking for would
be useful.  Last summer I spent a little time starting to write a
Delphi-based IDE for R, with the long-term aim being code completion,
etc.  I figured it would end up being portable to Linux at least,
since Borland had announced plans for a Linux version of Delphi (which
will be available later this month, by the way).

However, it's not at all an easy task.  From what I could see, R is
written to be in control of things; really what you need is for the
IDE to be in control, and R to act as a server.  The IDE needs to be
able to say things like "give me a string which represents how this
expression would be printed", or "show me the help file on this
token", or "show me a selection of help topics that might be
appropriate to this token", or "execute this expression".  Instead, as
far as I could see, the user interface operates by providing callback
functions to get user input and to print results, all under the
sequential control of some internal R loop. 

Presumably a server interface could be made (I think there's an R OCX
component, for example),  but it would take a pretty substantial
amount of work, and would have to be tied into the core code pretty
closely.  New R versions come out pretty frequently, and I would guess
that the internals change enough to break external code like an IDE.

If the IDE were written in Delphi (or anything else other than C),
things would be even worse, because you'd have to worry about header
translations with each new release.  On the other hand, while C does
have numerous good features, and is almost certainly the best choice
for the R source, writing the event driven object oriented code that
an IDE needs is not one of its strengths.  And I wouldn't expect a lot
of support from the R core team in writing it:  they don't use Delphi,
and they don't use Windows.

Duncan Murdoch
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list