From: matz@... (Yukihiro Matsumoto) Date: 2003-11-21T11:47:30+09:00 Subject: Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) Hi, In message "Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) )" on 03/11/21, Chad Fowler writes: |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). I just don't know. Only things I can tell you now are: * Types (or "interfaces" to avoid confusion) must be independent from class/module, otherwise they will be misused too often. Note that Sean himself once failed to distinguish these two. * Thus I refuse at least part of his RCR, which use class/module to define interface. Interfaces should be defined explicitly. * I'm sure I don't fully understand his new proposal in [ruby-talk:85888], but if it is statically checked at compile time as he explained, I wonder how much it is effective. We have many cases where that kind of "static interface check" would not cover, thus make it "false promise". I still need to examine his proposal to make the final decision. * The appearance matters. I think the code example in the proposal does not look like Ruby: class Stdin def Boolean eof? return is-at-end-of-file end def Integer read(Integer maxbytes) return bytes-read end end I'm not sure how to design the interface syntax in the Ruby Way. matz.