add support for scaling recipes by numerical factors

This commit is contained in:
Christoffer Müller Madsen 2017-04-08 20:44:27 +02:00
parent a1dc85b2f7
commit 92c70970f5

View File

@ -107,6 +107,11 @@
(make-recipe new-name new-servings new-ingredients new-steps) (make-recipe new-name new-servings new-ingredients new-steps)
)))) ))))
(define scale-recipe-by-factor
(lambda (recipe scale-factor)
(let ([new-servings (* (recipe-servings recipe) scale-factor)])
(scale-recipe recipe new-servings))))
;; Constructors ;; Constructors
(define make-recipe (define make-recipe