List comprehension-like workflow? #654
-
I have lists of the masses, diameters, and heights of various aluminum cylinders and I want to calculate their respective densities. How can I achieve that using Numbat? This is what I've been trying so far.
But the type checker won't let me pass lists into the function. Is there a way to get around this? I'm pretty new to Numbat so I appreciate any input! Thanks 😁 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can't easily do this with three lists, but if you make one list of structs each containing one mass, height and diameter, then you can use the map function to apply a function on each element. If you need I can provide a simple example implementation of this later when I have a little more time. |
Beta Was this translation helpful? Give feedback.
You can't easily do this with three lists, but if you make one list of structs each containing one mass, height and diameter, then you can use the map function to apply a function on each element.
If you need I can provide a simple example implementation of this later when I have a little more time.