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

@ -105,7 +105,12 @@
[new-steps steps]
[new-servings wanted-servings])
(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