[plt-dev] coding ideas from JaneStreet

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Apr 13 04:23:24 EDT 2010

On Apr 13, Eli Barzilay wrote:
> On Apr 13, Paulo J. Matos wrote:
> > Eli Barzilay <eli at barzilay.org> writes:
> > 
> > > On Apr 12, Matthias Felleisen wrote:
> > >> > 5. Code for exhaustiveness (pattern matches enumerate all
> > >> >    conditions).
> > >> 
> > >> What you can see is that almost all of these apply to programming
> > >> in PLT Scheme. Well, for 8, I will defer to Sam :-)
> > >
> > > #5 isn't in use outside of my class's language(s).
> > 
> > I was just going to ask how do you handle 5 in PLT Scheme. How can
> > you force a match to actually make you exhaust all conditions?
> The code that I'm talking about is a dialect of typed scheme that has
> ML-like type definitions and matching, with the same kind of errors
> when matches don't cover all cases, and when there are patterns that
> are not reachable.  It's working only for these type definitions (not
> on the usual scheme types, not on unions, etc -- only on types that
> were defined using the ML-ish form).  But for the class it provides
> the same advantage that ML has -- if you extend the AST definition
> with a new variant, the compiler will tell you where you're missing
> cases to deal with it.

(Oh, and while this is a dialect of TS, the code predates it, and did
the same with plain scheme structs previously.)

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

Posted on the dev mailing list.