|
Boost : |
From: Michael Kenniston (mkenniston_at_[hidden])
Date: 2002-04-23 13:22:26
Bill Kempf wrote:
> ... probably because you misunderstand what I want in a
> "universal representation". Let me explain.
<snip>
> What I'm
> proposing is a "universal representation" that all systems must be
> able to convert to and from. This allows for conversion to/from any
> time system to any other time system through an intermediary
> representation.
You're right, I did misunderstand what you wanted, and I can see
the practical value in requiring that all time systems provide
conversions to/from a common intermediary time system. There
may be a few systems where that doesn't make sense, so it might
be better stated as a convention/recommendation rather than a
strict requirement, but in any event it will certainly work for
all the classes that are most commonly used, and that's probably
good enough.
My primary worry is that no matter how carefully we document
the fact that such conversions are sometimes only approximations,
users will treat them as exact. Perhaps there is a useful
analogy here to floating-point numbers: novices tend to
treat them as exact, and can even get some useful work done
that way, but anyone who uses floating-point a lot soon learns
to be wary of their inexact nature. Since the vast majority
of programmers will /not/ have deep insight into time systems, I'd
like GDTL to provide them with as much assistance as possible
in getting things right. (A really good library not only
provides code that is worked out for you ahead of time, but
also concepts and analysis that are worked out for you as well.)
Perhaps something as simple as a good choice of name would do it,
e.g. call the templated routine "aprox_convert()". A separate
"exact_convert()" could be provided for those instances where exact
conversion is possible.
-- - Michael Kenniston msk_at_[hidden] mkenniston_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk