Skip to content

Commit

Permalink
conscript,local: add conscript/local/matchmaking
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Sep 12, 2024
1 parent c9c8184 commit b52b45c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
4 changes: 2 additions & 2 deletions congame-example-study/prisoners-dilemma.rkt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#lang conscript
#lang conscript/local

(require conscript/matchmaking
(require conscript/local/matchmaking
conscript/survey-tools
racket/match)

Expand Down
1 change: 1 addition & 0 deletions conscript/base.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
;; racket/system, ffi/unsafe or any system-level functionality.
(define whitelist
'(buid
conscript/local/matchmaking
conscript/matchmaking
conscript/survey-tools
gregor
Expand Down
12 changes: 11 additions & 1 deletion conscript/local.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,15 @@
;; stubs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(provide
get*
get*/instance
put*
put*/instance
form
defvar
defvar*
defvar*/instance
call-with-study-transaction
with-study-transaction
current-participant-id
current-participant-owner?)
Expand Down Expand Up @@ -293,8 +298,13 @@
[arg (in-list kw-args)])
(put (string->symbol (keyword->string kwd)) arg)))))

(define (call-with-study-transaction proc)
(proc))

(define-syntax-rule (with-study-transaction body0 body ...)
(begin body0 body ...))
(call-with-study-transaction
(lambda ()
body0 body ...)))

(module reader syntax/module-reader
conscript/local
Expand Down
19 changes: 19 additions & 0 deletions conscript/local/matchmaking.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#lang racket/base

(require conscript/local
(rename-in
conscript/local
[get* get-var*]
[get*/instance get-var*/instance]
[put* put-var*]
[put*/instance put-var*/instance])
racket/unit
"../matchmaking-sig.rkt"
"../matchmaking-unit.rkt")

(provide
(all-defined-out))

(define-values/invoke-unit matchmaking@
(import congame^)
(export matchmaking^))

0 comments on commit b52b45c

Please sign in to comment.