If you're like me, your attention span on a three-day weekend is too short to wade through all of Implementing an Internal DSL in Ruby. I've decided to be helpful to all of the confused people in the world who just don't see the special magic that goes in to writing an internal DSL. Here's the condensed version which helpfully fits on an index card. (That way, you can palm it at the next Rails meetup if you need a cheat sheet.)
If this doesn't sound very spectacular, you're absolutely right. I thought it important to take a break before the final, magical step which turns bog-standard rote programming into unicorn-and-glitter wonderful tooth-whitening DSL creation.
Congratulations! Unlike the poor slobs who merely declare classes and methods, give them meaningful names, and occasionally pass around first-class functions, YU WRITED AN DSL!! GRATE JOBZES!!!
Crikey (Score:1)
That took him months?
Frankly, I don't start to think it might be a pidgin until the code in those blocks starts looking pretty damned unrubylike. Class methods are for introducing the weird scope you need to make your declarative style pidgin work. Perl libraries like Jifty::DBI::Schema do something similar, they just have a different toolchain and 'feel' to them because Perl's prototyping pushes t