unit_system!(
load "si_prelude",
unit foo = 12 * meters,
)
in order to extend pre-defined systems of units with a few custom units.
Another option could be to allow calling unit_system (or rather a stripped down version of the macro) again in order to add units to the previously generated Quantity type, such as
It would be nice to be able to do something like
in order to extend pre-defined systems of units with a few custom units.
Another option could be to allow calling
unit_system
(or rather a stripped down version of the macro) again in order to add units to the previously generatedQuantity
type, such asHowever this requires persistence across multiple macro calls which is non-trivial (see https://github.com/rust-lang/rust/issues/44034)