[racket] match in Advanced Student?

From: Adam Shaw (adamshaw at cs.uchicago.edu)
Date: Mon Oct 31 22:34:00 EDT 2011

Thanks! That still doesn't work for color:

  match: color does not refer to a structure definition

although it does work with my own custom color struct:

(define-struct clr (r g b))
(match (make-clr 1 2 3)
  [(struct clr (r g b)) (* r g b)])

  - Adam

On Oct 31, 2011, at 9:26 PM, Jay McCarthy wrote:

> One of the branches of the pattern language is
> |	 	(struct id (pattern ...))
> Your pattern should be
> (struct color (r g b))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111031/914b7abb/attachment.html>

Posted on the users mailing list.