From: Sean O'Dell Date: 2003-11-22T02:51:21+09:00 Subject: Re: New Type Checking System Idea On Friday 21 November 2003 05:52 am, Greg McIntyre wrote: > It occured to me on the bus today... > > Can interfaces be changed at run-time? I think they shouldn't because > allowing interfaces to be updated any time after they've been created > would mean that every object implementing the interface would have to be > re-checked. Maybe one could iterate (or some faster search) through the > object space (ObjectSpace), but it seems better avoided. > > So this should be an error: > > interface IFoo > # some stuff > end > > # ... > > interface IFoo > # add more stuff to IFoo > end # => Error, redefinition of interface IFoo > > The reason I say this is because it works differently to the way Ruby > classes work in a similar situation. It therefore has baring on deriving > interfaces from classes implicitly (which I'm still thinking about, a > little bit). However if you do it explicitly and optionally, on a > particular line of code, I think you're fine because you choose at which > point to grab the class's interface. Not in my proposal. An interface is completely immutable. For that exact reason. =) Sean O'Dell