INTEGER!-led FUSED! could have a pretty good default behavior in addition and subtraction...
>> 10px + 20px
== 30px
>> 10px + 20em
** Error: Cannot add FUSED! unless non numeric portions match (px, em)
And with Backtick Literals it might give an answer for the longstanding question of putting units on currency.
>> `$10.20`USD + `$3.04`CAN
** Error: Cannot add FUSED! unless non numeric portions match (USD, CAN)
So we'd get some very limited dimensional analysis. There's nothing lower in sequence precedence than a FUSED! though...e.g. FUSED! lives under PATH!, so don't expect 10m/s * 20s
to work.
Although you could write 10[m/s]
... but I'm not imagining the built-in multiplication working this out for you. Just stopping you from adding 10[m/s] to 20s. But who knows--maybe handling a tiny bit of this would be valuable.
The precedence of TUPLE! beneath PATH! might be an asset here:
>> x: 10em * 20px
== 200[em.px]
>> x / 50
== 4[em.px/s]
Equality would bite you. Structurally we can't say 4[px.em/s]
is equal to 4[em.px/s]
. You'd need some kind of canonizing operation that would sort the sequences in a predictable order. SORT:DEEP ?
>> sort 'f.a:c.d/b.e:[h/g]
== b.e:[h/g]/f.a:c.d
>> sort:deep 'f.a:c.d/b.e:[h/g]
== 'b.e:[g/h]/a.f:c.d
All integers would have to be less than all WORD!s and LIST!s in sort order to use SORT:DEEP for this purpose.