[Development] Units in QML

André Somers andre at familiesomers.nl
Thu Feb 25 11:26:58 CET 2016



Op 25/02/2016 om 11:20 schreef Welbourne Edward:
> André Somers used m* for minutes and metres, footnoting:
>> )* Note the first clash already...
> I think it is fairly sane to just insist that SI units take precedence,
> especially given that we support multi-letter unit names (e.g. pt, px,
> mm, cm), so min will do fine for minutes.
Sure, fair point. It just goes to show that one will have to be careful 
claiming units in order not to cause clashes later on.
>
>> Numerical values could be implicitly convertable to quantities, but
>> not to each other unless such a relation is explicitly defined. That
>> should prevent anyone from trying to do 3cm + 4s.
> While I agree, I should note that the general case (for a language in
> which units are first-class citizens) would need to deal with the fact
> that some contexts shall want to deem certain dimensioned quantities as
> unities.  In particular, theoretical physicists routinely treat the
> speed of light as 1 (not 1 length-unit per time-unit but the pure number
> 1), identifying lengths and times as being "of the same kind".  At that
> point, 3cm is about a tenth of a light nano-second, so 3cm + 4s =
> 4.0000000001s is perfectly good arithmetic.  I mention this mostly as an
> argument against *trying* to deal with the fully general case ...
>
> 	Eddy.
What's wrong with in that case defining the conversion? Or resetting the 
default conversions and defining everything in "space-time"?

André




More information about the Development mailing list