[PYTHON MATRIX-SIG] A ramble on ofunc's and omath
Hinsen Konrad
hinsenk@ere.umontreal.ca
Sat, 16 Dec 1995 11:09:38 -0500
Yup, there are plenty of opportunities to build on and improve the basic
mechanism. Alot of this depends on how complex the C interface being exported
is.
Variables and functions are all there is to export; anything else (typedefs,
macros etc.) would have to be exported via header files even in the case
of statically linked C programs.
If something like this is to become an official feature of Python
it would be nice to add a minimum of support to CObjects, even if that
increases the code size too 300 bytes ;-) The aim should be to make
this feature as easy to use as possible and reduce potential
problems to a minimum.
For example, one could have a standard typedef for a structure that
contains the complete C interface to a module. Plus a standard special
name for the variable that holds the C interface (perhaps "__C__"),
and an access function that looks for this variable and retrieves
the pointer. Then add conventions for header files, and the only
difference between this mechanism and acess to a statically linked
module is two lines of code: one for the import, and one to
retrieve the C interface.
-------------------------------------------------------------------------------
Konrad Hinsen | E-Mail: hinsenk@ere.umontreal.ca
Departement de chimie | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal | Fax: +1-514-343-7586
C.P. 6128, succ. Centre-Ville | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7 | Francais (phase experimentale)
-------------------------------------------------------------------------------
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================