[racket-dev] TR for PL class

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Jan 1 11:57:31 EST 2011

On Sunday, John Clements wrote:
> Eli: You use a variant of TR for your PL class, right?


> Is your stuff fairly straightforward, or would it be a mistake for
> me to try to adopt it?

I think that it works very nicely (disjoint unions works very well for
the material).

> I just tried installing your .plt package, and got a few install
> errors (below, if you care), so it's hard for me to evaluate this
> myself.

Yeah -- the downside of being the only TR variant is that my code is
very sensitive to TR changes: the current version works only with
5.0.1.  I'll update it to work with 5.0.2 soon-ish.

> I took a quick look at your lecture notes, and it looks like you're
> using a "cases" form that (I'm guessing) adds static types to the
> PLAI setup. Yes?

I'm using `define-type' similarly to PLAI/EoPL except for using types
instead of predicates, and my `cases' is similar to PLAI/EoPL except
that it doesn't require to specify the type (it infers that from the
variants), it allows nested patterns, and the important feature is
that it barfs if there is incomplete coverage for the matched type (or
if there is "too much coverage" leading to unreachable cases).

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

Posted on the dev mailing list.