Hrvoje Niksic <hniksic(a)iskon.hr> writes in xemacs-beta(a)xemacs.org:
> We might want to begin this by reconsidering what we really want the
> modules modules to be able to do. So far the majority of the people
> asking for module functionality in fact want interface to foreign
> functions, or interface to fairly simple stuff coded in C for
> efficiency.
That sounds O.K.
> Virtually all else can be achieved by Lisp code in the first place.
Agreed.
> Thus a good first step for creating an API would be to *keep* the
> distinction of C/Lisp as the line between the implementation and the
> interface. For instance, we can say that the modules are allowed to:
> * Define Lisp functions, symbols, and variables using DEFUN,
> defsymbol, and friends;
> * Call existing Lisp functions using call* and Ffuncall(). For
> instance, call2 (Qfoo, make_int (1), Qbar);
> * Call a small set of C functions directly -- stuff like Fcons() and
> Fget(). Given that all the needed functionality is available under
> the previous item, the initial number of functions in this set could
> be kept minimal.
> Comments?
You left out
* define new lrecord types
* acess to a subset of standard symbols (for basic coding systems,
etc.)
Also, is macro expansion an issue?
Two other library interfacing issues I ran across doing the Postgres
interface are:
May I respectfully request that `define-error' be moved into C?
May I respectfully request that the functionality of XtAppAddInput be
added to the XEmacs event loop? The Postgres interface code needs
this to be able to deal with the asynchronous interface adequately.
Right now, hitting a blocking operation that never returns kills the
editor and that is unacceptable. I noticed in grepping the sources
that Didier's multicast code needs it too. It is not unreasonable to
have file descriptors that are read outside of XEmacs main logic. It
is also not unreasonable to allow them to be added to select(2) file
descriptor masks. Under Unix, we use select loops, either via Xt, or
via a home-brewed version when running tty-only. Does a similar
functionality exist under MS-Windows?