Finally, I would be remiss if I left out this delightful quip from Marak Squires:
I use to say, “I can bend space and time with .toString() and eval()”.
As is my habit, I have a slightly more nuanced approach.
First things first.
Many nerd-rage-fests convolve towards a petty squabble over definitions. For now, wikipedia says:
Metaprogramming is the writing of computer programs that write or manipulate other programs (or themselves) as their data
sure, good enough for me.
In practice, rubyists are used to flavors of eval, define_method and the venerable method_missing.
In ruby, there are special tools (instance_eval, class_eval, .send, define_method, &etc.) that you have to learn in order to have your code dynamically define the behavior of new objects and classes. Because of this special vocabulary that is not part of the day-to-day vernacular of the rubyist, the application of these techniques are given a special consideration and status.
call in their day-to-day work, it is not “arcana” like
Module#instance_method is within ruby-land.
Unfortunately, it may be coming in future versions. However, this is a moot point because