Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow loading preludes or extending previous unit_system calls #43

Open
Tehforsch opened this issue Dec 23, 2023 · 0 comments
Open

Allow loading preludes or extending previous unit_system calls #43

Tehforsch opened this issue Dec 23, 2023 · 0 comments
Labels
ergonomics Library usage ergonomics macro-syntax Changes or improvements to the syntax of the unit_system macro

Comments

@Tehforsch
Copy link
Owner

It would be nice to be able to do something like

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

unit_system!(
    ...
)

add_units!(
    unit foo = 12 * meters,
)

However this requires persistence across multiple macro calls which is non-trivial (see rust-lang/rust#44034)

@Tehforsch Tehforsch added macro-syntax Changes or improvements to the syntax of the unit_system macro ergonomics Library usage ergonomics labels Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ergonomics Library usage ergonomics macro-syntax Changes or improvements to the syntax of the unit_system macro
Projects
None yet
Development

No branches or pull requests

1 participant