[racket] match in Advanced Student?
One of the branches of the pattern language is
| (struct id (pattern ...))
Your pattern should be
(struct color (r g b))
On Mon, Oct 31, 2011 at 8:21 PM, Adam Shaw <adamshaw at cs.uchicago.edu> wrote:
> Since pattern matching has been a topic of discussion lately -- I'm trying
> to get simple pattern matching to work in Adv. Student -- for example this
> expression:
> (match (make-color 1 2 3)
> [(make-color r g b) (* r g b)])
> gets this response
> match: expected a pattern, but found a part
> I would appreciate an explanation or a pointer to how I can understand this.
> Thanks.
> - Adam
> _________________________________________________
> For list-related administrative tasks:
> http://lists.racket-lang.org/listinfo/users
>
--
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay
"The glory of God is Intelligence" - D&C 93