[racket] 'Adult' Racket? (was rackunit vs test-engine)
> Using `racket/generic' (new in 5.3!):
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> #lang racket
>
> (require racket/generic)
>
> (define-generics pokeable
> [poke! pokeable])
>
> (struct mascot ()
> #:methods gen:pokeable
> [(define (poke! self) (printf "Ho ho!\n"))])
>
> (define pillsbury-dough-boy (mascot))
> (poke! pillsbury-dough-boy)
>
> (struct cartoon-character (name)
> #:methods gen:pokeable
> [(define (poke! self)
> (printf "~a: that tickles!\n" (cartoon-character-name self)))])
>
> (define homer (cartoon-character "Homer"))
> (poke! homer)
Oooh. I like! I'll definitely look into racket/generics.