[plt-dev] struct match-expander a la struct-copy

From: Richard Cobbe (cobbe at ccs.neu.edu)
Date: Wed Jun 3 06:28:30 EDT 2009

On Tue, Jun 02, 2009 at 08:49:20PM -0600, Jay McCarthy wrote:
> The structure patterns in scheme/match have always bugged me that they
> didn't let you put the fields in any order and you had to put in _ for
> the fields you didn't care about.
>
> I've remedied this with a new match expander, struct*. I'd like to put
> in the tree. Do people agree?

Looks great to me; the problems with the built-in struct patterns have long
annoyed me.

My views.plt package on Planet addresses some of the same problems that
you've identified, but the overlap isn't complete.  Views also handle
abstract data types, and they're by-position instead of by-name.  Indeed,
when I get a chance, it would be interesting to add the by-name matching to
views along side the existing by-position system.

Richard


Posted on the dev mailing list.