> Worth reading the comments where someone points out a much simpler and more elegant solution, although it's still not an ideal situation.
I'm always wary of such "<language X> isn't great because..." posts as I find that the frustration is as much a function of the developer's competence, (lack of) imagination and familiarity with the language and its idioms, as it is with the language itself.