;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/beer.el (defun beer2beer (alc-src &optional alc-dst num vol-src vol-dst) (or alc-dst (setq alc-dst alc-src)) (or num (setq num 1)) (let ((vol-std 50)) (or vol-src (setq vol-src vol-std)) (or vol-dst (setq vol-dst vol-std)) ) (/ (* alc-src vol-src num) (* alc-dst vol-dst) )) ;; (+ (beer2beer 3.5 5.3) (beer2beer 2.8 5.3 2) (beer2beer 4.0 5.3 2 27.5)) ;; (beer2beer 12 5.3 2 20) ;; (beer2beer 12 5.3 1 75) ;; (beer2beer 5.3 nil 5 33) ; 5 33cl 5.3% = 3.3 50cl 5.3% ;; (beer2beer 1.8 5.3 6) ; 2.0 - lättöl (1.8%) ;; (beer2beer 2.8 5.3 6) ; 3.2 - två-åtta (2.8%) ;; (beer2beer 3.5 5.3 6) ; 4.0 - folköl (3.5%) ;; (beer2beer 4.2 5.3 6) ; 4.8 - mellanöl (4.2%) ;; (beer2beer 5.3 5.3 6) ; 6.0 - starköl (5.3%) ;; (beer2beer 7.2 5.3 6) ; 8.2 - sju-tvåa (7.2%) (provide 'beer)