#lang racket
(require [only-in plait test test/exn error print-only-errors])
(define (mk-o-state count)
(lambda (m)
(case m
[(inc) (lambda () (set! count (+ count 1)))]
[(dec) (lambda () (set! count (- count 1)))]
[(get) (lambda () count)])))
(define-syntax snd
(syntax-rules ()
[(_ obj selector args ...)
((obj (quote selector)) args ...)]))
(test (let ([o1 (mk-o-state 3)]
[o2 (mk-o-state 3)])
(begin (snd o1 inc) (snd o1 inc)
(list (snd o1 get) (snd o2 get))))
'(5 3))