From: "vidar.hokstad@..." Date: 2006-02-09T00:03:22+09:00 Subject: Re: Meta-Meta-Programming Erik Veenstra wrote: > (Although my original post wasn't about type checking, or about > duck-type checking. It was about how to implement such a > wrapper...) The generic wrapper is absolutely interesting :) It was the typing part that triggered my interest, though, because I do prefer stricter type checking myself. _But_ at the same time I like the ability to selectively use it where it matters, such as to document and enforce genuine constraints and trigger errors as early as possible (as a consequence, I don't see that much value in checking for a specific type, but I did like the ease of checking for support for a specific method) To me "ducktyping" doesn't preclude fairly strict type checking. Haskell, for instance, for all intents and purposes provides most of the same flexibility in terms of typing from the programmers point of view, but still enforces typing strictly by inferring which types would satisfy the requirements of a specific piece of code. Barring that kind of support in the Ruby interpreter, being able to selectively and easily wrap type check around code where the requirements are non-obvious and hard to check is quite useful. I like the possibilities this has for aspect oriented programming for things like debugging and testing too - by injecting wrappers to manipulate or check parts of the interactions in the tested code (I did read most of RCR 321 that someone else mentioned too, but the appeal of your suggestion is the size/simplicity of the implementation) Vidar