Boost logo

Boost :

From: Eric Ford (eford_at_[hidden])
Date: 2001-09-14 18:26:15


> But why wouldn't this all be handled at the user interface level?
> Once we are in the actual code wouldn't the function look just as
you
> describe.
>
> energy/particle * particles/second * seconds of exposure
>
> There is no mention of anything to do with calories, ergs, etc in
this
> equation.
>
> So my claim is the following. We have 3 people working on a system:
a
> physisist, a doctor, and a user. The physisist writes some code.
The
> doctor writes some code. The user runs the code. None of the
> functions written by either the physisists code or the doctors would
> mention electron volts or ergs or calories. Only when the user
types
> in some inputs would actual electron volts be mentioned, or when the
> program prints out results might calories be mentioned. Why would
> these ever be used explicitely in the code of the physisist or the
> doctor themselves? This is the question I don't understand.

That's fine. But the compiler needs to know that that expression
returns an energy and allow assignment of that expression to any
variable with dimensions of energy, regardless of what units the three
quantities are expressed in. However, the compiler should generate an
error if someone tried to assign that expression to a variable with
dimensions of time.

E


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk