On Fri, Jan 27, 2012 at 01:43:17PM -0800, Alan Irwin wrote:
> 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.

Arjen has now implemented this, and with a little debugging we have clean
"make test_diff_psc" results again and a more robust implementation of 
f95 string handling. 

Thanks Arjen!

Andrew

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to