diff options
| author | Matthew Fennell <matthew@fennell.dev> | 2026-04-16 16:37:56 +0100 |
|---|---|---|
| committer | Matthew Fennell <matthew@fennell.dev> | 2026-04-16 18:34:37 +0100 |
| commit | 7770aa9aa15f35997b75a0da961ca778af542557 (patch) | |
| tree | a710158dc9afb620f3163dfe4f7c42e1c3e6a73c | |
| parent | 5dce88bcad0a1263984b71fa19ef26393d781960 (diff) | |
Simplify score function
Every line is passing the booking separately for no reason. By putting it in
the lambda, we can make each score read more fluently.
| -rw-r--r-- | config.scm | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -12,12 +12,12 @@ (define default-user matthew) (define (default-scorer booking) - (let ((score (lambda (cond amount) (if cond amount 0)))) + (let ((score (lambda (pred amount) (if (pred booking) amount 0)))) (+ - (score (rob-friendly? booking) 4) - (score (badminton-60min? booking) 2) - (score (sat? booking) 1) - (score (unreasonable-time? booking) -8) + (score rob-friendly? 4) + (score badminton-60min? 2) + (score sat? 1) + (score unreasonable-time? -8) ))) (define (rob-friendly? booking) |
