[PYTHON MATRIX-SIG] A ramble on ofunc's and omath

Hinsen Konrad hinsenk@ere.umontreal.ca
Fri, 15 Dec 1995 09:05:15 -0500


   > That is certainly preferable. However, I am not sure whether it
   > is possible in all cases with the current implementation. Clearly
   > there is not much provision for C modules that depend on each other.
   > Your proposed CObjects solve one problem, but there may be more.

   There may be, but I haven't though of any yet.  If you come up with any, I'd be
   happy to try to come up with a solution to them too. :-]

It seems that you can do everything necessary with these CObjects. After
all, you can make all non-static variables and functions known in this
way, and then you have published everything that other statically
linked C modules have access to.

A potential problem is that another module can do whatever it wants
with the CObjects, including something wrong (like calling a variable).
This can be avoided (except for intentional misuse) by providing
a header file that decribes the public features of a module.

One could produce a tool (in Python, of course!) that produces such
a header file with the prototypes of the original module code.
It could be made so easy to use that except for an additional import
call at the beginning, another module could use all functions and
variables exactly as if they were statically linked. And then one
could pack the whole interface for a module into a single CObject,
which helps keeping a module's name space clean.

-------------------------------------------------------------------------------
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
=================