summaryrefslogtreecommitdiff
path: root/models/nutrient-measurement.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'models/nutrient-measurement.rkt')
-rw-r--r--models/nutrient-measurement.rkt7
1 files changed, 4 insertions, 3 deletions
diff --git a/models/nutrient-measurement.rkt b/models/nutrient-measurement.rkt
index 23ee9e3..d3631de 100644
--- a/models/nutrient-measurement.rkt
+++ b/models/nutrient-measurement.rkt
@@ -21,7 +21,7 @@
[get-nutrient-measurement-values (-> nutrient-measurement?
(listof (cons/c nutrient? number?)))]
[get-nutrient-measurement-value (-> nutrient-measurement? nutrient? number?)]
- [get-latest-nutrient-measurement-value (-> nutrient? number?)]
+ [get-latest-nutrient-measurement-value (-> nutrient? (or/c number? #f))]
[delete-nutrient-measurement! (-> nutrient-measurement? void?)]))
(require racket/contract
@@ -124,7 +124,7 @@
(cond
[(null? rows) #f]
[else
- ;; Fold all nutrient rows belonging to the single measurement into one struct
+ ;; Fold all nutrient value rows belonging to the single nutrient measurement into one struct
(define the-id #f)
(define A #f)
(for ([row (in-list rows)])
@@ -134,7 +134,8 @@
(set! A (if A
(acc (acc-measured-on A)
(cons nv-pair (acc-pairs A)))
- (acc measured-on (list nv-pair)))))
+ (acc measured-on
+ (list nv-pair)))))
(and A
(nutrient-measurement the-id
(acc-measured-on A)
Copyright 2019--2025 Marius PETER