Eu salvei no Delicious:

Daniel Azuma: Implementing DSL Blocks

18 Novembro 2009, 10:23:50 | Visitar

thumbnail

http://www.daniel-azuma.com/blog/view/z3bqa0t01uugg1/implementing_dsl_blocks

A DSL block is a construct commonly used in Ruby APIs, in which a DSL (domain-specific language) is made available inside a block passed to an API call. In this paper I present an overview of different implementation strategies for this important pattern. I will first describe the features of DSL blocks, utilizing illustrations from several well-known Ruby libraries. I will then survey and critique five implementation strategies that have been put forth. Finally, I will present a new library, Blockenspiel, designed to be a comprehensive implementation of DSL blocks.