Sunday, January 04, 2009

Show Me Your Meta

I'm working on a presentation on Ruby metaprogramming, and I'd love to have more examples from the outside world. If there's any piece of metaprogramming you've seen in open-source code that you thought was particularly clever, readable, convoluted, or gratuitous, please comment or email with links to the source (or at least a pointer in the general direction).

If you have some non-public-source example you think is interesting, please feel free to email me along with information about how I can use the example (and whether you want "credit" for supplying it).



Sudhindra Rao said...

Hi John,
I know you must have seen this code already, but incase u missed it


drew olson said...

Interesting stuff here. What about talking a bit about instance_eval and the tradeoffs for using it within DSLs. I really enjoyed this article for a deep dive about the tradeoffs (not endorsing the gem, though):

Anonymous said...

If you are talking about define_method, it might be worth talking about its strange behavior with respect to arity in ruby 1.8: