From: Alan W. I. <ir...@be...> - 2001-11-01 16:37:02
|
On Wed, 31 Oct 2001, Geoffrey Furnish wrote: > Also, I think the java binding is probably the only one that does the > automatic float<-->double conversion thing. I'm undecided about > whether that is something we want in a compiled binding like C++, but > I am pretty sure we /do/ want this kind of functionality for the > script language bindings. Not that "script language" is an accurate > characterization of java, but you know what I mean. OTOH, I haven't > ever looked deeply at the Perl or Octave work, so perhaps there is > coolness there that I don't even know about. Could you summarize in one or two sentences how your treatment of single-precision or double-precision java arguments relates to object-oriented programming concepts such as classes, sub-classes, instances, etc? I am really new to these concepts (I only read the general Java tutorial on OOP, yesterday, plus some of the equivalent part of my python book) so I am trying to relate what you have done to my limited knowledge of OOP. Anyhow, the result is the java user can use the same name of plplot routine regardless of type of argument and regardless of whether the back-end was built --with-double or not. Java sorts it out (I assume through the magic of OOP) into a call to one of two versions of the function in javabind.c with either single or double-precision arguments. Once the appropriate version is entered, the code handles the assignment (with appropriate cast if needed) of the single (or double) precision quantities to PLFLT quantities in a nice way. Assuming this transparent (for the user) implementation of transforming float or double arguments to PLFLT depends to a certain extent on OOP, then it would be natural as a *long-term* goal to use the same idea for the other front-ends such as c++, python, and perl that also give access to OOP. I don't know whether octave allows OOP. Yorick certainly doesn't so yplot only works with the double-precision version of the PLplot library. Alan |