[racket] match plus #:super structs => no nice fit?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Tue Sep 21 17:38:36 EDT 2010

This isn't going to work because #:super uses runtime information to
find the super struct while struct can only communicate with match
statically.

Jay

On Tue, Sep 21, 2010 at 3:31 PM, John Clements
<clements at brinckerhoff.org> wrote:
> It looks to me like match doesn't work nicely with #:super structs.  For instance, this program:
>
> #lang racket
>
> (struct a (f1 f2))
> (struct b (f3) #:super struct:a)
>
> (match 'whocares
>  [(struct b (f1 f2 f3)) 13])
>
>
> signals the error:
>
> match: wrong number for fields for structure b: expected 1 but got 3 in: (f1 f2 f3)
>
>
> It's easy to work around this, but it would be nice if it worked.  Am I missing something obvious?
>
> John
>
>
>
> _________________________________________________
>  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://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.