role/anon

This commit is contained in:
Tony Garnock-Jones 2012-07-16 17:01:16 -04:00
parent 5797a25789
commit 50f52283bb
2 changed files with 7 additions and 1 deletions

View File

@ -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)))

View File

@ -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 ...)))