-
Notifications
You must be signed in to change notification settings - Fork 8
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
Full support for units.net features? #26
Comments
Hi @eddiesholl Thanks for your comment. I haven't yet thought much about how to design it, need to find some extra time for it :) However, JavaScript (and TypeScript) is missing important and complex features compared to the strong-typed C#. For instance, there is no way to overload operations, which forces operations implementation to be something like: Specific to your example with cross conversions, TypeScript does support abstract classes, so it should be possible to implement. Did you already have some specific design in your mind? |
No nothing yet, I was more trying to think ahead to how much more could be possible. I’ll let you know if I get some time to try anything out |
Hey there,
Stumbled on this library recently, for what it offers it’s a great API. I was wondering if you’d looked into the possibility of a full replication of units.net? An example of what might be possible, is cross conversion of units when you multiply and divide, so length.mul(anotherLength) returns an area, that sort of thing.
looking in the original repo, it’s all driven by even more codegen than is used here. I was just wondering if you’d already looked into what that whole task would look like, and if it would even work.
not sure if typescript method overloading would allow this sort of thing, for example.
That full API, where units are tracked for you in a type safe way, would be pretty freakin cool, I think.
thanks!
The text was updated successfully, but these errors were encountered: