diff --git a/congame-example-study/prisoners-dilemma.rkt b/congame-example-study/prisoners-dilemma.rkt index 849f6de..0864220 100644 --- a/congame-example-study/prisoners-dilemma.rkt +++ b/congame-example-study/prisoners-dilemma.rkt @@ -1,6 +1,6 @@ -#lang conscript +#lang conscript/local -(require conscript/matchmaking +(require conscript/local/matchmaking conscript/survey-tools racket/match) diff --git a/conscript/base.rkt b/conscript/base.rkt index 35ed004..4ed902d 100644 --- a/conscript/base.rkt +++ b/conscript/base.rkt @@ -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 diff --git a/conscript/local.rkt b/conscript/local.rkt index 26d2353..82182ef 100644 --- a/conscript/local.rkt +++ b/conscript/local.rkt @@ -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?) @@ -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 diff --git a/conscript/local/matchmaking.rkt b/conscript/local/matchmaking.rkt new file mode 100644 index 0000000..e20c98b --- /dev/null +++ b/conscript/local/matchmaking.rkt @@ -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^))