Something close in Racket... You could define a match-expander whose runtime use was the class.<div><br></div><div>Jay<br><br><div class="gmail_quote">On Tue, Dec 14, 2010 at 9:53 AM, Jim Wise <span dir="ltr"><<a href="mailto:jwise@draga.com">jwise@draga.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">David Van Horn <<a href="mailto:dvanhorn@ccs.neu.edu">dvanhorn@ccs.neu.edu</a>> writes:<br>
<br>
> I learned that every Scala object that defines an apply method can be used<br>
> as a function. Cute. It's nice to see a language emphasize the symmetry<br>
> between objects and functions.<br>
<br>
</div>Note that this is actually bi-directional in Scala -- any object which<br>
defines an unapply() method can be used in an ml-style pattern matching<br>
statement as if it were an algebraic type constructor...<br>
<font color="#888888"><br>
--<br>
Jim Wise<br>
<a href="mailto:jwise@draga.com">jwise@draga.com</a><br>
</font><br>_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Jay McCarthy <<a href="mailto:jay@cs.byu.edu" target="_blank">jay@cs.byu.edu</a>><br>
Assistant Professor / Brigham Young University<br><a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br><br>"The glory of God is Intelligence" - D&C 93<br>
</div>