[plt-scheme] Yet another cute idea
At Fri, 27 Sep 2002 16:54:28 -0400, Eli Barzilay wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> On Sep 27, Noel Welsh wrote:
> > Now hold on one cotton-pickin' minute boy! We got
> > match-let, match-let* and match-letrec. Durn me if
> > they don't provide pattern matching to introduce new
> > bindings. Sheesh, you kids think you know
> > everything...
>
> Yes it does -- and yes, between Swindle, my `match' form, and that
> fact that all this is basically used free time, I managed to
> completely forgot about it. But what bothers me in that approach
> which is pretty standard is the fact that patterns are really
> `special' in the sense that they don't look like what made them.
> Either a pattern like `(foo x y)' matches a list of three arguments,
> or you hack an addition that will match something else -- and I want
> the set of patterns to be expendable -- I want to match structures,
> objects and random things that I feel like matching.
Yes, that's the real problem.
This plays into upcoming work on units. Currently, unit signatures
provide special support for structures. As it happens, one result of
this special support is that `match' can work on structure instances
where the structure type is imported into a unit.
As we revise the unit system, we need to think about how to make the
signature syntax extensible. Whatever the solution, I imagine an
extensible `match' will work essentially the same way. And then they
have to work together somehow!
Matthew