aboutsummaryrefslogtreecommitdiff
path: root/module/util
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-04-30 19:17:35 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-04-30 23:04:01 +0200
commitaa44c16ce953c090b2eb3ce580c60fa8934a7720 (patch)
tree11710e34de01a2ac31e5acac9c8a62af3f09888a /module/util
parentUpdate server to use app. (diff)
downloadcalp-aa44c16ce953c090b2eb3ce580c60fa8934a7720.tar.gz
calp-aa44c16ce953c090b2eb3ce580c60fa8934a7720.tar.xz
Change call signature for [gs]etf.
Diffstat (limited to 'module/util')
-rw-r--r--module/util/app.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/module/util/app.scm b/module/util/app.scm
index 95df741a..e5b03b0f 100644
--- a/module/util/app.scm
+++ b/module/util/app.scm
@@ -26,18 +26,24 @@
body ...))])))
-(define (getf app field)
+(define-method (getf field)
(aif (hashq-ref (get-ht app) field)
(force it)
(error "No field" field)))
(define-syntax setf%
(syntax-rules ()
+ [(_ field value)
+ (setf% (current-app) field value)]
[(_ app field value)
- (hashq-set! (get-ht app) field (delay (begin value)))]))
+ (hashq-set! (get-ht app) field (delay value))]))
(define-syntax setf
(syntax-rules ()
+ ;; special case to use current appp)
+ [(_ key value)
+ (setf% key value)]
+
[(_ app) app]
[(_ app key value rest ...)
(begin (setf% app key value)