Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (18 sloc) 660 Bytes
#lang s-exp "../lang/base.rkt"
(provide (all-defined-out))
(define-struct event (kvpairs))
(define (event-keys an-evt)
(map car (event-kvpairs an-evt)))
(define (event-ref an-evt a-key)
(define clean-key (cond
[(symbol? a-key)
[(string? a-key)
(string->symbol a-key)]
(raise-type-error 'event-ref "symbol or string" a-key)]))
(define kv (assq clean-key (event-kvpairs an-evt)))
(cond [(eq? kv #f)
(error 'event-ref "Could not find key ~a" a-key)]
(car (cdr kv))]))
Jump to Line
Something went wrong with that request. Please try again.