On 2011-03-20 18:00-0400 Hezekiah M. Carty wrote:

> On Tue, Mar 8, 2011 at 7:06 PM, Alan W. Irwin <ir...@beluga.phys.uvic.ca> 
> wrote:
>> On 2011-03-06 19:58-0500 Hezekiah M. Carty wrote:
>>
>>> OCaml should be matching more closely now:
>>
>> Hi Hez:
>>
>> The C implementation of the range adjustment sucked in an obvious way
>> so I had to change it and all other implementations of example 27
>> including the OCaml one.  Since I am floundering around with the OCaml
>> language (programming by analogy rather than from any knowledge of
>> what I am doing) could you review my x27.ml change (revision 11613)?
>>
>
> The changes look good to me.
>
>> That revision does give the same answer as C, but it strikes me that the
>> "style" of the xmin, xmax, ymin, and ymax reference logic is quite
>> distinct from all other floating point calculations so you may want to
>> change it to be consistent with the rest.  Furthermore, I don't
>> understand at all why xmin, etc., must be initialized since that
>> happens in any case for i==0.  But if I dropped that "unneeded"
>> initialization the ocaml compiler complained.  So I left it in with a
>> comment.
>>
>
> This is due to a few facets of the OCaml language.  OCaml does not
> allow you to create uninitialized values - there is no "null" value.
> This is why the values need to be initialized.  It also has the happy
> result of no segfaults in pure (no external C) OCaml programs.  OCaml
> values are also immutable by default - the "ref" keyword is used to
> create a mutable value.  These differences from C imposes a bit of
> extra effort when porting examples from C and trying to stay as close
> as possible to the original C style.
>
> I hope this clarifies things somewhat.  Thank you for propagating the change!

Hi Hez:

Thanks for your review of my changes and OCaml language explanations. 
It appears programming by analogy with other programming fragments
with no real knowledge of the language works.  :-)

As you can tell I have been distracted by a whole bunch of other
PLplot topics.  And there is at least one more big one to come (my
planned attempt to get Lua into a clean "diff" state).  But after
that, I do still plan to get back to the plcolorbar issues we
discussed.

Best wishes,

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
__________________________

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to