tiffany352 / rink-rs

Unit conversion tool and library written in rust
https://rinkcalc.app/about
GNU General Public License v3.0
408 stars 28 forks source link

Quantity namespacing #125

Closed tiffany352 closed 2 years ago

tiffany352 commented 2 years ago

Makes quantities occupy a different namespace from units. This means you can no longer write them in expressions as though they were units, which was confusing.

Fixes #12, which is one of the longest standing bugs in Rink.

Before (highly misleading):

❯ gold density
gold:
• density = 1 kilogram / meter^3 (density)

After:

❯ gold density
No such unit density, did you mean paperdensity?

If the name of a quantity is entered alone, then a definition result like this will be displayed:

❯ density
Definition: density = physical quantity for mass / volume (kg / m^3)