Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (18 sloc) 0.66 kb
#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)
a-key]
[(string? a-key)
(string->symbol a-key)]
[else
(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)]
[else
(car (cdr kv))]))
Jump to Line
Something went wrong with that request. Please try again.