From: Sean O'Dell Date: 2003-11-21T07:59:56+09:00 Subject: Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) On Thursday 20 November 2003 02:40 pm, Chad Fowler wrote: > On Fri, 21 Nov 2003, Yukihiro Matsumoto wrote: > > # > # In summary, "interface checking" (not static type checking we had seen > # before) is a good thing. But I'm not sure it's good enough to put in > # the future Ruby, where API document might help, and where we have two > # challenges above. > # > > > matz, how do you define "interface"? In sean's case, class and/or module > were sufficient to define interface. This is majorly what I take issue > with. If "interface" is really a collection of "respond_to?" > requirements, then I can start to stomach the idea of it being added to > Ruby (I believe you were proposing something similar in your RubyConf > presentation). Have a look at Sean's RCR at RubyGarden. It includes the > following: No, class/module were NEVER enough. I've made two proposals (one RCR and post new idea posted here), and neither of them used class/module except as a proposed way to indicate an interface was implemented. But class and module has nothing, at its heart, to do with it, I just put them up there to show one way to do it. It was primarily an "interface id tagging system" and the tags could be stuck onto objects in any fashion: by the class they came from, by an explicit declaration, through a method call, or through some sort of object-to-interface mapping system. The point of the RCR was, there was no interface definition, it was just an interface id tag system. Class and module were just one way of showing how it could work. Read on, and let's skip the RCR I proposed. I see now that people want something more fulfilling than a simple empty promise than the interface id tagging system was providing. > > class MyClass > end > > The above class implicity declares "I implement the MyClass interface." > Pretty simple. > > > He goes on to say the same re: inheritance and module inclusion. > > Do you consider these to define "interface"? I don't. True, my RCR did not define an interface, and by design. I was under the impression that type checking was unwanted and so I came up with a very loose design. It was intentional. Read my post in this newsgroup/mailinst list titled "New Type Checking System Idea." This, I think, is much closer to what people are asking for. As an aside, I am curious why you and Ziegler and several others participate in this way. Rather than beating people up for their ideas, why don't you point out how they could be improved, or come up with your own ideas? I can't deny that no one liked my RCR, but in the process I really feel attacked, and badly. Can't you guys figure out some other way to export your ideas rather than holding them private and then just swatting away anything a person has to say on the subject? What are your ideas for something like this? Post them up ... let's hear a proposal. I promise, I will be kinder to you than you were to me. Sean O'Dell