Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The while/let pattern allows us to stay in a loop, as long as some matching is true.

Let us define a tagged union to register measurement values and the absence values:

We define then a function that generates some Measure values depending on an index:

Let us initialize a global index:

And use it to iterate over the Measure values returned by the get_measure() function. We use the while/let construct to extract the float values returned by the function. As soon as a Nil is returned, we will quit the loop:

0 1.12 2.24 3.3600000000000003 4.48 5.6000000000000005 6.720000000000001 7.840000000000001 8.96 10.080000000000002