Replies: 2 comments
-
One more nit: since unit lists are not first-class ideas in Numbat, I had to manually define the string formatter above. Thanks to f64 precision, you end up with some unexpected/ugly results with the above implementation. For example:
Obviously the seconds field should be rounded to zero, but Numbat isn't aware of that because I produced that value by subtracting out a |
Beta Was this translation helpful? Give feedback.
-
See #112 (comment)
See #201
See #261
Let's discuss this in #364
This is extremely annoying, yes. See #150
Good idea. I added a comment in #112 (comment) |
Beta Was this translation helpful? Give feedback.
-
In the context of #364, I tried implementing a unit list display function for "pace" units (expressed in time units per mile).
Here's what I came up with. Please let me know if I'm missing something obvious and there's a cleaner, simpler way to do this:
This works, but I have a few issues with the above, which was loosely based on the implementation of
human()
time display function.let
bindings allowed in functions as far as I can tell. This makes defining local reusable variables impossible and mandates helper functions/recursion to get new variables with scoping.human()
helper functions in the REPL as well.s
for the partially-built string in helper function calls and got an error because it conflicted with the alias forseconds
. This makes it difficult to use short, readable local variable names.There are probably other things to be done to improve ergonomics, but these are the ones that jumped out at me. Not sure how feasible each of these is, but I'd like to hear others' thoughts.
Beta Was this translation helpful? Give feedback.
All reactions