Unit values
Brian Rice
water at tunes.org
Wed Apr 27 09:55:27 PDT 2005
I think the attention you two have given this library has reached a
threshhold. If you read the source, you'll see that I just ported it
from Smalltalk-80 and didn't care too much about it.
Right now, you two care more about it than I do. So put your fingers
where your mouth is, and code up these changes yourself and use darcs
send so I can apply them.
Patches speak louder than words! :)
On Apr 27, 2005, at 7:41 AM, David Hopwood wrote:
> Brian Rice wrote:
>> On Apr 26, 2005, at 11:50 AM, Adde wrote:
>>> I added the px method to Number traits to be able to say: 1 px
>>> instead of 1 with: px, don't know if that's a good idea but it
>>> certanly makes it easier to use. The other methods are just
>>> placeholder for XML-specific formatting.
>> The "px" message idea has occurred to me before, and I think what
>> I'll do is have the BaseUnit creation method name:abbrev: create the
>> method for you so you don't have to do it. How does that sound? :)
>
> Suggestion: merge the UnitValue and Unit types, by having a unit behave
> as 1 of that unit, i.e. px = 1*px.
>
> Then only multiplication is needed to form a UnitValue, e.g. 42*px.
> Similarly examples like "(72*px) / in" would work automatically. This
> design also allows derived units and conversion factors to be expressed
> more simply.
--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/
More information about the Slate
mailing list