Hacker News new | ask | show | jobs
by bramstein 5851 days ago
I played with the same idea a couple of years ago and published a library for it: * http://www.bramstein.com/projects/jfun/ * http://www.bramstein.com/articles/pattern-matching.html * http://www.bramstein.com/articles/advanced-pattern-matching....

Although the implementation works great, I couldn't get past the (obvious) syntax issues and never actually used it in production code. It was an interesting experiment though, especially when combined with Sjoerd Visscher's algebraic data type library (http://w3future.com/weblog/stories/2008/06/16/adtinjs.xml).