[Grace-core] Some notes on pattern matching on the wiki

James Noble kjx at ecs.vuw.ac.nz
Fri Jul 1 03:06:12 PDT 2011


So, after talking to Michael  (see his post earlier today :-)
he said he'd like some more language features to work on.

So Ive added a few more pages to the Wiki about pattern matching

This one gives quite a lot of detail about a possible implementation - rewriting pattern
matches into non-matching lambdas,  plus message requests between objects to actually do the match.
It is complex, but it does the job and is flexible.  

https://projects.cecs.pdx.edu:8443/~black/NewOOL/index.cgi/wiki/GracePatternMatchingSemantics


These two - give two different pattern-matching syntaxes, based on Scala & Newspeak

https://projects.cecs.pdx.edu:8443/~black/NewOOL/index.cgi/wiki/GracePatternMatchingSyntaxScala
https://projects.cecs.pdx.edu:8443/~black/NewOOL/index.cgi/wiki/GracePatternMatchingSyntaxNewspeak

I hope to sleep on this, and add a third page here about a compromise for Grace :-)


Kim & (Eric, when you're back) it would be good to post about your patten match design too.


James


PS - one thing I note, is that "class names" now have another interpretation
 * as the name of the factory object to which one sends new
 * as the name of the type of the resulting instance
 * as the name of the "pattern" used to match against instances.

I'm not sure how all those names work. One simply solution is to unify these into a single object
that plays all three roles... 

James


More information about the Grace-core mailing list