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 for "forced let" #412

Open
joshop opened this issue Apr 4, 2024 · 1 comment
Open

Allow for "forced let" #412

joshop opened this issue Apr 4, 2024 · 1 comment

Comments

@joshop
Copy link

joshop commented Apr 4, 2024

I'd like there to be a way to force creating a variable even if it would conflict/overwrite a previously defined unit, or even just "kill" an existing unit definition so it can be overwritten. For example, the Minecraft mod GregTech has a simplified system of electric energy distribution with units of "amps" and "volts" that use the real world symbols, but do not actually correspond to the real world units. I'm making a numbat module for working with this game's mechanics and would like to be able to redefine the existing A and V to refer to those units. Also, the game has a unit of volume called the "bucket", denoted B - this would conflict with the builtin unit of byte, but units of information are simply not relevant in the calculations this module is designed for, so overwriting it wouldn't lose any functionality. Is the only way to accomplish this by simply not including the prelude, and redefining necessary units as I see fit?

@sharkdp
Copy link
Owner

sharkdp commented Apr 4, 2024

Thank you for your feedback!

I'd like there to be a way to force creating a variable even if it would conflict/overwrite a previously defined unit, or even just "kill" an existing unit definition so it can be overwritten.

We definitely want to implement something like this. Please see #293 and #86 for previous discussions.

For example, the Minecraft mod GregTech has a simplified system of electric energy distribution with units of "amps" and "volts" that use the real world symbols, but do not actually correspond to the real world units. I'm making a numbat module for working with this game's mechanics [...]

Awesome 😍. Great to see someone playing with custom unit systems. I hope we can cover your use case even better in the future.

Is the only way to accomplish this by simply not including the prelude, and redefining necessary units as I see fit?

For now, if you really want to use A, V and B, I'm afraid this is the only way. The prelude is modular, so you might be able to include some existing modules in your own prelude (like the ones in core)... but I have never really played with this and I'm afraid that this approach is a bit limited (as a lot of things depend on units::si. Even if we don't have overwritable units, we might be able to implement something like #55 — which might also help in some of these cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants