On 2009-01-06 00:03-0800 Alan W. Irwin wrote:

>
> N.B. I am pretty sure you could stick strictly with the procedural form of
> plgfnam (and thick counterpart) in Ada examples 31 if you used some
> string-trimming function to get rid of the trailing garbage for the filename
> output to stderr.  However, please do not do that since I think the current
> implementation in Ada examples 31 is a better way to go since it exercises
> both the procedural and functional forms of plgfnam while also
> getting rid of the trailing garbage in stderr.

Hi Jerry:

I woke up this morning with a different conclusion on this matter.  There is
no need to slavishly follow the C language and provide a procedural form to
return strings using argument lists.  Instead, the functional form is fine.
This is well understood, for Python, for example, where all returned values
must be implemented with a functional form.  Also, Doug and I have just been
through this for the Perl/PDL examples.  In general, the functional forms of
plgdev, plgfnam, and plgver are just much easier to use for returned
character strings so that is all the Perl/PDL bindings provide, and I think
we should do the same in Ada.  I have looked at Ada examples 14 which use
the functional form of plgdev to determine the value of an Unbounded string,
and it is pretty clear that is a better way to go then the alternative
procedural form where you have to specify a string of sufficient size so you
don't get a buffer overflow. This is just an accident waiting to happen in
C, but there is no need to propagate that bad situation to other more
sophisticated languages such as Ada.

So here is what I think should be done.  Remove all the procedural forms
of plgdev, plgfnam, and plgver and rely exclusively on the functional form.

Do you agree to this change?

If so, I will do the work and change examples 31 accordingly.

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
__________________________

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to