On Sun, 25 Jun 2000 12:01:42 EST, the world broke into rejoicing as
Robert Graham Merkel <[EMAIL PROTECTED]>  said:
> Sorry it's taken me a while to reply, but better now than when we
> implement anything.
> 
> Everything you've written so far makes sense, but I've just got a
> couple of comments on your requirements list.
> 
> As well as Gnucash developers, 
> users will write their own Scheme code that makes use of
> the new monetary math interface.  It would be desirable to make it as
> simple as possible.  
> 
> Something like:
> 
> (+ x y)
> 
> with (money-plus x y current-unitary-precision)
> 
> where x and y are variables of "type" money (and can be of any legal
> precision), and current-unitary-precision is a data structure storing
> the precision information for the result of the computation.
> 
> I'm undoubtedly missing the subtleties of things here (for instance,
> is it legal to add two quantities of different precisions together)
> but a simple interface, particularly for Scheme code, is *very*
> important IMHO.

The other issue that this brings up is that there needs to be _some_ 
semantic designed to allow having this cope well with adding a _bunch_ of
values together, as with:
  (money-plus a b c d e f g)
or 
  (apply money-plus txn-values-from-report)

Frankly, I don't see that this is likely to be a terribly awful problem;
if it takes a bit of work to work up how money-plus should be defined,
that doesn't strike me as a _big_ problem.  Scheme is more "malleable"
than C in this manner, so I'm quite sure it will be easy enough to have
it follow whatever proves acceptable for C.

> Oh, and one other thing.  Performance when doing monetary arithmetic
> is currently not an issue.  As far as I can see, this isn't likely
> to change, whatever implementation we end up using.  Is this the case?

I expect that there's 100 times as much processing time being devoted to
GTK; the problem with messing around with special data formats is _not_
going to be one of performance, but rather whether or not someone trying
to write some code to work with "GnuCash Numbers" in C is going to pull
out a gun and shoot someone over whatever inconvenience gets introduced...
--
[EMAIL PROTECTED] - <http://www.ntlug.org/~cbbrowne/lsf.html>
"How should I know if it  works?  That's what beta testers are for.  I
only  coded  it."   (Attributed  to  Linus Torvalds,  somewhere  in  a
posting)

--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]


Reply via email to