-
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
Phobos Integration #2
Comments
Thank you. I will consider the suggestion, but I don't have enough time right now to submit something up to standard. |
from what I can see, it is pretty good already. a lot of people will complain anyway, just because they don't want new stuff in phobos or because they are jealous that their code was not merged. It was discussed at dconf, with the powers that are, that phobos needs to be powerful and that we need something similar to boost::unit. just move it to std.experimental, create the PR and push for it. |
@biozic, I agree with @burner. This is the best D unit library yet! I can help you out too if you want to. If this gets into Phobos other languages will be major jealous! Two things:
enum second = unit!(Numeric, "T");
enum hertz = 1 / second;
writeln(hertz); currently prints 1 [T^-1] I believe the developer would prefer to have it be printed in a similar compact way as 1 hertz provided such a mapping exists. I'm not sure how to solve this though. We sooner or later need to put the foot down and specify that a What do you think? |
@nordlow Thanks for your feedback ! I've updated the README file to make clear some design principles and their consequences. They result in unusual features (or lack thereof). Especially, one could say that it is a 'dimensions' library, not a 'unit' library (and that could be controversial). This makes me feel that, though it's quite usable, the library may not be fit for Phobos yet. Concerning the two points you make:
I work on it from time to time, but don't expect fast evolution :( I would happily accept help improving the design and/or the implementation! |
This library is fantastic. It is so useful. Great work! I would really love to see it included in Phobos as std.dimensions or std.quantities. PS: Apologies if this is not the correct place to leave a comment :-/ |
any news? |
Or std.unit. No news yet. I'm willing to start working on PR for Phobos. We need comments from the github D team in order to know in which direction to go. |
Sorry for the blackout. I have no time to work on anything important concerning this project. If somebody wants to take it over to bring it to Phobos, I'm OK with it. I would be of little help unfortunately. |
@nordlow so you are creating a PR against phobos? |
Yeah, I can put my work on this onto a Phobos module. What should we call it?: |
awesome. or maybe call it std.experimental.quantities to keep the name close to the original |
According to http://chemistry.about.com/od/unitsconversions/fl/What-Is-the-Difference-Between-Quantity-and-Unit.htm I believe I don't think the original naming should matter at all. Ok? |
Ok! |
It is awesome you took the time to figure this out. Put this effort into the PR and it will pass with flying colors. |
@burner ... I believe there will be a looong and very interesting discussion about the details ;) |
@nordlow I fear you are right. I can only advise you to point to the link if you think they make a solid point, and then stop feeding the troll. |
@nordlow That's great if you can work on this to bring it to Phobos! I also anticipate a long discussion about the implementation, but also about the notions. Be careful of misconceptions: for example, the link that you posted earlier is plain wrong about quantities and units; see the SI brochure: "The value of a quantity is generally expressed as the product of a number and a unit. The unit is simply a particular example of the quantity concerned which is used as a reference, and the number is the ratio of the value of the quantity to the unit.". Nonetheless, |
AFAICT, David's Nadlingers solution is better because it offers a more flexible conversion architecture. Typically it allows representing units separated from values. See forum discussion at http://forum.dlang.org/thread/[email protected]?page=1 I've cleaned up David Nadlingers implementation a bit and put it https://github.com/nordlow/units-d for anyone review or improve. I've added a TODO list. I'm currently struggling with understanding I wanted to add support for representing scaled units with arbitrary precision (both integer and floating Point) but the current logic contains a bug prohibits this. Typically we want to be able to to represent angles in degrees in integer precision and do logic on integers before they are, on demand, converted to floating point, before feed builtins such https://github.com/nordlow/units-d/blob/master/src/experimental/units/si.d#L143 Further, David Nadlinger wants to refactor I'm hoping David or someone more skilled in CT-logic would take on the task of fixing this. It's above my skill and time resources. PRs are very welcome. It's also ok with me if somebody forks this repo and takes over the responsibility of adding this to Phobos. |
quantities is awesome, you should push for phobos inclusion!
The text was updated successfully, but these errors were encountered: