Wednesday, July 29, 2009

How to module_eval

In my whole Ruby Metaprogrammer life I have never used any *_eval string.
This was a deliberate choice I made and I still believe that it was reasonable in the sense that it suits my style. Personally I was able to structure and refactor my metacode much better, well, I thought...

Now I am working on code that shall be used as a library, closely related to core, thus, hopefully widely used. I am not a fan of premature optimization. I often use methods like Enumerable#inject for there elegance not worrying at all about the speed.
This is the exception
But then there is this of course:

2 comments:

robert said...

Robert, there seems to be something missing here.

Robert Dober said...

Oops it is already published, I better get it finished then, thx for pointing this out.
The résumé will be that I will generate the code and not eval it BTW.