Support optional priority in on-event

This commit is contained in:
Tony Garnock-Jones 2016-07-17 00:26:28 -04:00
parent 1334bd3abb
commit 0a0feee01b
1 changed files with 3 additions and 2 deletions

View File

@ -333,12 +333,13 @@
(define-syntax (on-event stx)
(syntax-parse stx
[(_ clause ...)
[(_ prio:priority clause ...)
(quasisyntax/loc stx
(on-event* #,(source-location->string stx)
(lambda (e)
(core:match-event e
clause ...))))]))
clause ...))
#:priority prio.level))]))
(define (on-event* where proc #:priority [priority *normal-priority*])
(add-endpoint! where