On Tue, Jan 04, 2005 at 02:53:49AM +0900, Jamis Buck wrote:
>    it would be nice to find a way to do away with the hard-coded limit
>    altogether.)

I don't think this is really feasible.  The problem is that there is no
portable way to create new C functions on the fly.

There are two solutions I know of, neither of which I like:

  - Use dlopen() to open a shared library that contains one functions:
    the callback function.  Since dlopen() returns the same handle if you
    open a shared library more than once, the library must be copied
    to another filename first.

  - Use a library that already knows how to define new C functions
    on-the-fly.  The GNU objective C compiler can do this, for example
    (with the LAMBDA macro).  Usually these libraries make use of asm
    tricks that aren't very portable.

Paul