Archive for February, 2009

I lamented earlier about the absence of a racecondition-free find_or_create implementation and somewhat promised to check back with a working implementation. YES, WE CAN: NOW is the time, folks!
As stated there the first thing missing is an advisory locking implementation. With the database as the natural choice for a synchronisation point that implementation [...]


Ever done Erlang? Now I wondered how flexible ruby would be and if an erlang style pattern matcher can be done in ruby. As it turns out, I came pretty close:
You might recognize this:

m = matching! [ 1, [ :a, 2 ], 3 ] do
on [ a ] [...]


…or: There is a difference between methodname(args) and self.methodname(args)!
The way how ruby deals with private, protected and public messages was a bit unclear to me. So I decided to dig a bit into it and to find out how it is really working. Finally I have irb installed: so lets go and explore.
This pastie shows [...]