unit package has reached loadable state (woo hoo!)
Subject: unit package has reached loadable state (woo hoo!)
From: Robert Dodier
Date: Tue, 26 Apr 2005 16:07:45 -0700 (PDT)
Hi Cliff,
Thanks for posting the message about the unit package.
I have a few comments which I hope will be helpful.
The package you wrote, and the older one, seem to assume
that units and the quantities to which they attach are
more or less inextricable. I think I'd rather see the
units separate from the quantities, like this: 12`m
represents 12 meters; a`s represents a seconds;
((a+b)*(a-b))`km^2 represents ((a+b)*(a-b0)) square km; etc,
using back tick ` as an operator. Operations on q`u objects
are suitable for tellsimpafter, for example,
tellsimpafter (qu1 * qu2, (first(qu1) * first(qu2)) ` processunits
(second(qu1) * second(qu2)))$
after appropriate declarations.
Such a representation has two merits, I believe. One is
that it makes a clean separation between quantities and
units, so that it's clear in every case which is which,
and it's trivial to isolate either one. The second is that
it might simplify units handling, so we may be more likely
to get what we want from the implementation.
In reference to the second point, I believe the q`u
representation obviates the need for post_eval_functions,
since it is now easy to identify the operations requiring
processunits: they are just the arithmetic operations
involving ` objects. There may be other motivations for
post_eval_functions, but I think units processing can
proceed without it.
At some point in the near future I'll post my half-baked
tellsimpafter hacks in hopes of better illustrating what
I'm getting at here.
All the best,
Robert Dodier
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com