Although Instance_eval can be a great tool for creating clean DSLs it does, unfortunately, suffer from a few shortcomings. These shortcomings are caused by the ‘change in self’ of the block and may, in some circumstances, lead to surprising behaviour.
_why detailed a lot of these shortcomings in his blog post and proposed a wonderful solution: [...]
Filed under: C, metaprogramming, programming, ruby | Tagged: dup_eval, iclass, instance_eval, mixico, mix_eval, MRI, ruby, ruby C API, ruby dup | 2 Comments »