|
Boost : |
From: wb_at_[hidden]
Date: 2001-09-11 18:30:27
Dean Foster <foster_at_[hidden]> wrote
on Mon Sep 10 14:44:11 2001:
<sig snipped>
| I like many of the ideas in the SIunits approach, but it seems that it
| is kinda brittle towards extension. I think it is important that new
| units be trivial for the user to create. So my question for those
| that know the SIunits system better is: "What would it take for a user
| to add a new dimension?" How would say a Dollar be defined? I want
| it to be different from pure numbers and different from all other
| types. But, I want to be able to talk about Dollars/kg (where kg is
| one of the units previously built into SIunit).
|
| Ideally I'd like to see a layered system.
|
| (1) A basic level of units that are easy to define.
| (2) A SI layer that implements the SIunits on top of it.
|
| Then if other units (say Dollars) were also defined they would
| "inherit" from the basic level and thus play well with the SIunits.
| Ideally, it should only take a few lines to define a new unit.
|
| p.s. I of course am not an impartial observer! The above layering is
| the way I implemented my units library. But I never got around to
| actually implementing the SI stuff since it never was needed by me.
As the author of SIunits, I, of course, am also "not an impartial
observer" with respect to issues related to quantity libraries, and so
I have delayed my reply to this note until I had a chance to download
and look over the "layering" in your library.
From my perspective, SIunits has even more layers than the two
described above. For example, SIunits supports "views" as one
aspect ("layer"?) of user customization, in order to support, for
example, users who work with very large or very small numbers, or who
need alternate bases of mensuration. (See my paper, for example, for a
brief discussion of what has to happen when a user wants to recalibrate
such that the speed of light is 1.) Five such "views" are currently
supplied, are inter-operable, and more are welcomed.
I agree that users should also be able to define additional units, but
it seems we are using different definitions. A unit (short for "unit
of measure," in my usage) reflects some amount of a measurable
"quantity," to use SI parlance. Thus, "meter" is a unit that measures
a "length" quantity. Similarly, "dollar" would be (if SIunits were to
support it) a unit that measures a "money" (or is "currency" a better
name?) quantity.
Adding new quantities, too, is useful. However, you are suggesting
adding a new quantity that requires adding a new "dimension" first. I
understand what you are proposing, but the International System of
Units does not provide any guidance in this direction. While it would
be very easy to extend SIunits thusly (and, indeed, I had once done so,
as I wrote in a previous posting), I believe this should not be at all
done lightly. I disagree, therefore, with the characterization that
SIunits is "kinda brittle" in this regard; it was a deliberate design
decision, based on user feedback, to disallow arbitrary user extension
into additional dimensions. At least one Booster has already posted
his agreement with this position.
However, I believe that you may well have unique expertise to help
design and craft a generally useful Currency class, one that obeys all
the rules peculiar to financial computation and does do in a manner
that complies with the appropriate standards in this area. There was
some discussion, not too long ago, on this mailing list about the need
for such a class, but I do not know what, if anything, has come of it.
If such a class could come to fruition, I would like to be the first to
give serious attention to its interoperability with SIunits.
Although we have some differences in our points of view (which I hope
we can soon reconcile), I certainly appreciate your support for "many
of the ideas in the SIunits approach."
- WEB
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk