From: Glenn Parker Date: 2005-04-04T21:19:26+09:00 Subject: Re: Ruby rite (Ruby 2.0) vaporware or real? Luke Graham wrote: > > The app could test any object that claims to implement the interface > by ... > > AnInterface.instance_methods.each { |pm| > object.respond_to? pm ? raise "Bad object!" > } Duck typing does not require that every class implement every possible method in a given interface, so this test would be too broad. But this thread gets me thinking that those who want some "compile-time" style type-checking could implement a DSL to assist themselves in Ruby. -- Glenn Parker | glenn.parker-AT-comcast.net |