Post by HÆ°ng GiaMany libraries make use of variable argument list. If I want to
create a binding for Oberon to work with ONBC, how could I implement
it? Or I have used Oberon wrong all the time, that Oberon was
designed to be a standalone language and everything should be done on
Oberon alone and interfacing to other libraries not needed? I think
Oberon is a general purpose language and want to do GUI in Oberon, so
I plan to create a binding for GTK+. I don't know if I could
accomplish this job but the first show stopper is va_list.
Variadic functions in C break type safety. That's one of the reasons
there is no similar feature in Oberon.
Post by HÆ°ng GiaAnother problem is I have to doubled the work. First to write an
Oberon module then having to edit the generated C source which is the
the actual binding. So I asked if we could make it easier to use a
header like solution, .def file as GNU Modula-2 does, to simplify
the process? So I only have to write the .def file once then just
use it.
Mapping Oberon procedures directly to C functions can only be done in
some cases. For instance, a C function can return a character pointer
but an Oberon procedure cannot. Moreover, if you pass a non-terminated
string to an Oberon procedure which is implemented in C you can catch
the invalid parameter with an assertion. If the C function is called
directly the program will probably crash.
-- Karl