On 2012-12-04 17:53:57 -0500, Ray Racine wrote: > How does one bind an identifier to the matched structure?
You can use an `and` pattern. In your example:
(define js (Person "Joe" "Smith"))
(: do-it (Thing -> String))
(define (do-it thing)
(match thing
;; shadow `thing` here
((and [Person fn ln] thing)
(displayln fn)
(person-name thing))))
(do-it js)
Cheers,
Asumu
____________________
Racket Users list:
http://lists.racket-lang.org/users

