role/anon
This commit is contained in:
parent
5797a25789
commit
50f52283bb
|
@ -1,6 +1,6 @@
|
|||
;; Emacs indent settings
|
||||
(progn
|
||||
(mapcar #'(lambda (x) (put x 'scheme-indent-function 1))
|
||||
'(transition sequence-actions))
|
||||
'(role/anon transition sequence-actions))
|
||||
(mapcar #'(lambda (x) (put x 'scheme-indent-function 2))
|
||||
'(role role/fresh yield)))
|
||||
|
|
6
os2.rkt
6
os2.rkt
|
@ -34,6 +34,7 @@
|
|||
transition/c)))
|
||||
|
||||
role
|
||||
role/anon
|
||||
role/fresh
|
||||
(except-out (struct-out add-role) add-role)
|
||||
(rename-out [make-add-role add-role])
|
||||
|
@ -267,6 +268,11 @@
|
|||
topics-expr
|
||||
(handlers presence-handler absence-handler message-handler)))])))
|
||||
|
||||
;; For use when you don't care to invent a name for a role.
|
||||
(define-syntax-rule (role/anon topic pieces ...)
|
||||
(role (gensym 'anonymous-role) topic pieces ...))
|
||||
|
||||
;; Invents a role name for you, and binds it to pre-eid-var.
|
||||
(define-syntax-rule (role/fresh pre-eid-var rest ...)
|
||||
(let ((pre-eid-var (gensym 'role)))
|
||||
(role pre-eid-var rest ...)))
|
||||
|
|
Loading…
Reference in New Issue