From: Henning T. <pl...@he...> - 2006-07-12 16:01:45
|
On Fri, 7 Jul 2006, Jerry wrote: > I took the API reference literally if it said that a parameter is an > output, and made the corresponding Ada parameter say "out", rather > than "in out" which would be allowed by a C pointer or a Pascal or > Modula-3 "var". Since Modula-3 does not know OUT parameters, I turn such parameters into return values, possibly bundled in RECORDs, when there are multiple ones. Because of Modula-3's garbage collector, I can nicely work with references, without destruction of input parameters. This allows a very functional style of programming. But, as far as I know, Ada does not have a garbage collector and thus treating output parameters as OUT is certainly the best way. > The following subprograms in the Common API had output scalars which > required special attention to make sure that Ada understands that > some arguments are output scalars and not pointers to arrays. I've > included a few notes that may be of interest to the documentation > writers and to the Modula-3 binding writer. Please note that I have > used 5.5.3 for plplot.h and 5.6.1 for the API documentation. Also, > note that not all routines which return results begin with "plg". I started on some specialised interface file (was it Java or Python?), and I have probably missed additions to the main header file. Originally I hoped that SWIG allows me to keep to the main development path. However since the main plplotcapi.i has not enough type information, this has failed so far. Either we come to an agreement to replace plplotcapi.i by a file with more specific types (which wouldn't bother C compilers, because they keep on seeing 'int's) or I'm happy if you add missing functions to the interface prepared for Modula-3, such that we can share our work. |