I have uploaded a simple object calculus interpreter to the download section in miscellaneous Haskell. The interpreter supports method invocation, updates, parameters, named self-references and more.
Here are some examples of evaluations.
> [l1 = 2 + 3].l1
5
> [l1 = 1, l2 = self.l1].l2
1
> [l1 = {x} [l1 = {y} x, l2 = 3].l2].l1
3
> [c = 0, set = {x} x.edef("c", "y", $0), get = self.c, inc = self.set(self.get + 1)].inc.inc.get
2
Many more examples are available in the test-files.
I recently wrote that I was getting tired of OO programming. That is true, the thing that I'm getting tired of is having to repeat the same patterns over and over again when writing a program. I sometimes wish that I could just write the patterns once and for all, alas OO programming is not really powerful enough for that.
Therefor I'm now switching to functional programming, more specifically to Haskell. Functional programming basically consists of only functions and parameters. No variables, no states and none of the side effects. It also brings a lot more power to the table, with for instance higher order functions.
As a first step I have ported the Simple Sudoku Solver from Java to Haskell. The Haskell version uses the same algorithm, but in a functional environment. Though it is probably apparent, by reading the code, that I still think in OO terms.
In order to become more comfortable with the language I'm going to try to use Haskell in as many of my future projects as possible. The next steps for me will be to read up on Haskell conventions, documentation procedures and then test IO and GUI programming with Haskell. I have created a new project, Miscellaneous Haskell, to house all further test programs in Haskell.