-
Notifications
You must be signed in to change notification settings - Fork 1
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
Some usability suggestions #5
Comments
Hey! Thanks for your recommendations.
You want this to end up with the seconds^2 unit, however, it doesn't have to be a 2 in the exponent... what if it was:
Now if exp_var is dimensionless, this now is in 1 (seconds^exp_var) units. This is annoying because now the dimensions and types depend on values that have been put into them in runtime, making it much harder to check the types. I mean, I think it's possible, but it would probably get very confusing. I have an underlying theory of dimensional analysis, that basically a unit is dimensionful if you can define a function that can convert any unit into an equivalent set of other units (I should probably write this down somewhere). Doing what you propose does violate this underlying theory. s4 however, might be possible
This could simply be syntactic sugar for Or I might have an exception that thinks along the lines of "If the exponent is a constant integer, then just multiply it into the type". But then it's confusing when you have a number that's not 1, say does
|
Also note that (1 seconds)^2 or (2 seconds)^2 right now compiles to nothing. Intuitively I was expecting it that it would be equivalent to (2 seconds)*(2 seconds). Maybe worth specifying in the documentation that only dimensionless quantities can be exponentiated? 4.& 5. Yep, this is tricky, and more like a nice to have. Similarly one could think of automatically understanding seconds, minutes, days, weeks, years, out of the box. I imagine that it would become clearer which of these might be worth implementing as pedant is used more. |
compiles but
doesn't. Which might be easier on the intuition for a beginner, but confusing for someone who might use pedant heavily. And yes, the documentation needs a lot of work, I've added this problem in #8. |
|
Priority, importance: low. These were just things I came across.
Of these, the one that bugs me the most is unit exponentiation. It took a while until I realized that
The text was updated successfully, but these errors were encountered: