[racket-dev] [plt-scheme] Bug or misuse? match-expander ids not properly working (patch)

From: Eli Barzilay (eli at barzilay.org)
Date: Fri May 4 16:37:00 EDT 2012

20 minutes ago, Carl Eastlund wrote:
> 
>     Currently, there *are* already two problems: (1) people who want to
>     define an identifier matcher but can't;
> 
> That's a missing feature, and one in high demand, but personally I'd
> rather go without a feature than break an often-relied-upon feature
> of binding positions.  Better than either tradeoff is to find an
> implementation for the feature that doesn't break anything else. 
> Your proposal thus far is to completely ignore the breakage.  For
> instance, you referred to the one fix proposed so far as "overkill",
> despite it being simple and direct.

In case it wasn't clear enough, I said that I don't mind having it
(and I'm willing to add it) -- I only added that I don't see any
*practical* case where you'd use it.


>     (2) people using `null' in a
>     pattern and get very confusing behavior.  The second is probably more
>     important -- I've seen students try things like
>    
>      (define (flatten l)
>        (match l
>          [null null]
>          [(list null more ...) (flatten more)]
>          ...))
> 
>     And any time a "well behaved" mechanism leads to that kind of
>     confusion that make me fumble for an explanation, that suggest a flaw
>     in the design of that mechanism.  (In a similar way to allowing
>     (define 'x ...) -- and that is a more accurate analogy than the
>     above.)
> 
> Perhaps we need a different match form for students, much like the
> other special cases in student languages.

These are not HtDP students -- consider them as any other kinds of
newbies.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.