From b310f6e261e623237f0379c954df040cf4e57a4c Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sat, 1 Nov 2025 19:02:22 +0100 Subject: Apply minor fixes. --- models/nutrient-measurement.rkt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'models/nutrient-measurement.rkt') 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) -- cgit v1.2.3