On 2012-01-25 11:36-0000 Andrew Ross wrote: > On Wed, Jan 25, 2012 at 11:06:06AM +0100, Arjen Markus wrote: >> Hi Andrew, >> >> On 2012-01-25 10:57, Andrew Ross wrote: >> >>> If the string contained characters, then just the characters were passed >>> (with trailing spaces removed). If a null string was passed (i.e. of >>> length 0), then the returned string was a C NULL string. If the fortran >>> string was of length > 0, but was all spaces, then a single space was >>> passed to C. This seems entirely arbitrary. It made the examples work, >>> but wouldn't definitely do what the user expected. >>> >>> I suggest we continue as we are following Alan's changes, i.e. pass >>> EXACTLY the fortran string to C. The onus is then on the user to ensure >>> the string is the right length or to strip any unnecessary spaces. We >>> can't do this manually since we don't know which trailing spaces are >>> necessary and which are not. >>> >>> This will be an API change for the f95 bindings, and will require >>> a number of examples to be updated. Are people happy with this? >>> >> >> Well, what I have been thinking about is the following: >> Rather than divine (in the spirit of the old implementation) if trailing >> blanks are significant, let the user append an achar(0) as the last >> character if trailing blanks are significant. I will rework the >> examples to incorporate that. >> >> It can be as simple as: >> >> call pllab( 'Tight string ', & >> 'String with trailing blanks '//achar(0)) >> >> We can even define a PL_END_OF_STRING parameter to the module, so that >> this implementation detail is hidden. >> >> That way the changes are minimal - we will need to document this of course. > > I like this idea better as most of the time users won't want the trailing > spaces. > > Would be less invasive changes to the examples as well.
Thanks to both of you for looking into this issue deeper than I did. You appear to have reached consensus between you on the best thing to do so I will be happy to go along with that. 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); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); 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 __________________________ ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Plplot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-devel
