Is your boolean really one?
(if use-oat-milk? (make-coffee :oat-milk) (make-coffee :milk)) ;; ALTER TABLE ingredients ADD COLUMN use_oat_milk boolean;
# Making Coffee
I guess we are branching now and need to test both cases.
(cond use-oat-milk? (make-coffee :oat-milk) use-almond-milk? (make-coffee :almond-milk) :else (make-coffee)) ;; ALTER TABLE ingredients ADD COLUMN use_almond_milk boolean;
# Making "Coffee"
More branching. Hopefully nobody does funky business in one of them
;; CREATE TYPE fake_milk AS ENUM ('oat', 'almond', 'goat', 'rice', 'hemp'); ;; ALTER TABLE ingredients ADD COLUMN milk fake_milk; (def fake-milks {:oat :oat-milk :almond :almond-milk}) (make-coffee (get fake-milks milk-option))
# Milking it
Consider using a regular value and mapping to achieve more flexibility.
Bonus: no branching logic
By Jochen Bedersdorfer
Software Engineer