summaryrefslogtreecommitdiff
path: root/config.scm
diff options
context:
space:
mode:
authorMatthew Fennell <matthew@fennell.dev>2026-04-16 16:37:56 +0100
committerMatthew Fennell <matthew@fennell.dev>2026-04-16 18:34:37 +0100
commit7770aa9aa15f35997b75a0da961ca778af542557 (patch)
treea710158dc9afb620f3163dfe4f7c42e1c3e6a73c /config.scm
parent5dce88bcad0a1263984b71fa19ef26393d781960 (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.
Diffstat (limited to 'config.scm')
-rw-r--r--config.scm10
1 files changed, 5 insertions, 5 deletions
diff --git a/config.scm b/config.scm
index 46d0bf2..f07403b 100644
--- a/config.scm
+++ b/config.scm
@@ -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)