You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to be able to look up a unit type from the unit label, but since these are not 'registered' with the package do I have to search the type tree?
No, if I make the the unit labels into functions, I can just blindly call the label-function: 3u"mm" -> "mm" -> mm(1) -> 3*mm(1).
Since */-^ are not valid function identifiers, I can't make literal label-functions for complex units like Kg-m/s^2. Instead I need to insert logic into u_str to break that into atomic label functions and return Kg(1)*m(1)/s(1)^2.
How does u_str() work?
With a little magic; simply defining a macro u_str(arg) leads to the correct handling of 3u"mm", there must be some internal stripping of _str and parsing of 3u"mm" into 3 * (return of macro u_str("mm")).
The text was updated successfully, but these errors were encountered:
How does this work in Unitful and DynamicQuantities?
I need to be able to look up a unit type from the unit label, but since these are not 'registered' with the package do I have to search the type tree?
No, if I make the the unit labels into functions, I can just blindly call the label-function: 3u"mm" -> "mm" -> mm(1) -> 3*mm(1).
Since */-^ are not valid function identifiers, I can't make literal label-functions for complex units like Kg-m/s^2. Instead I need to insert logic into u_str to break that into atomic label functions and return Kg(1)*m(1)/s(1)^2.
How does u_str() work?
With a little magic; simply defining a macro u_str(arg) leads to the correct handling of 3u"mm", there must be some internal stripping of _str and parsing of 3u"mm" into 3 * (return of macro u_str("mm")).
The text was updated successfully, but these errors were encountered: