[Plplot-devel] Ada bindings and examples

2007-06-01 Thread Jerry
Some time back, Alan suggested that I make what amounts to a new,  
third, Ada binding, and I agree that this is a good idea.

Of the two Ada bindings which I have called thick and thin, the  
thin binding adheres to the C API of PLplot, using the same  
subroutine names, argument lists, and data structures including type  
names.

The thick binding differs in several ways. The subroutine names have  
been changed to be more pleasing to programmers from the Ada culture,  
the data structures have been changed to be more Ada-like thus  
requiring a shorter learning curve, argument lists have been modified  
by removing array dimensions since Ada has true arrays which include  
their beginning and ending indices and thus their sizes, many  
constants (mostly integer) have been given names (e.g. one can use  
Red instead of 1 but 1 still works--see xt12a.adb), and a  
number of high-level easy-plotters have been included which in part  
exploit Ada's ability to have variable argument lists and which take  
care of much of the PLplot set-up (look in the early parts of  
plplot.ads).

Because of the new subroutine names in the thick binding, some  
programmers may find it annoying to deal with two names for each  
subroutine when using the documentation and this is the crux of  
Alan's suggestion, which was to make what amounts to a new thick  
binding but which uses the traditional PLplot subroutine names.

I'm willing to make a version of the thick binding that substitutes  
the traditional PLplot subroutine names for the names that I used in  
the thick Ada binding for those Ada programmers who find it more  
convenient to look up things in the PLplot documents that way, but  
note that:
   (a) I have carefully kept the traditional subroutine names in a  
comment immediately before the new names in the thick binding,   
plplot.ads (specification) files as well as the plplot.adb (body)  
files specifically for ease of looking up function names. I use them  
all the time and it's not that big of a deal.
   (b) I doubt that there will be many Ada programmers using the thin  
interface. Consequently, I feel that the examples should use only the  
data structures from the thick interface, because those are the data  
structures that Ada programmers will be using in their coding.

To summarize: The plan is to make a quasi-third Ada binding which is  
exactly like the current thick binding except that the subroutine  
names are the traditional PLplot names. There will be two example  
files for each example, one written to the thick binding and one  
written to the new binding. The naming conventions are e.g. for  
Example 1, xt01a.adb is written for the thick binding and x01a.adb is  
written to the new binding.

Coding for the Ada examples should use Ada constructs and functions  
as needed. (See the other note from me today relating to the sprintf  
problem from a few days ago.)

Once an example is complete for one binding, the corresponding  
example can be automatically generated by a series of string  
substitutions for subroutine names on the source--that's how I plan  
to generate the new binding as well.

Jerry


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Ada bindings and examples

2007-06-01 Thread Alan W. Irwin
On 2007-06-01 15:18-0700 Jerry wrote:

 [...]To summarize: The plan is to make a quasi-third Ada binding which is
 exactly like the current thick binding except that the subroutine
 names are the traditional PLplot names. There will be two example
 files for each example, one written to the thick binding and one
 written to the new binding. The naming conventions are e.g. for
 Example 1, xt01a.adb is written for the thick binding and x01a.adb is
 written to the new binding.

 Coding for the Ada examples should use Ada constructs and functions
 as needed. (See the other note from me today relating to the sprintf
 problem from a few days ago.)

 Once an example is complete for one binding, the corresponding
 example can be automatically generated by a series of string
 substitutions for subroutine names on the source--that's how I plan
 to generate the new binding as well.

Sounds like an excellent plan.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel