From: Robert Klemme Date: 2008-02-02T01:09:41+09:00 Subject: Re: Gedankenexperiment on method duck type safety 2008/2/1, Daniel DeLorme : > A lot of other people have gone down this road, but patching "static" > type checking into a dynamic language is IMHO futile. Right. > However I think > something interesting could be done with a static/compiled dialect of > ruby where method signatures are inferred from the method body. e.g.: And how do you ensure only code compiles that satisfies this static constraint? How do you make sure that only objects are passed that satisfy this constraint? Basically this can only be done if you statically explore all (and I mean *all*) possible execution paths of a program. I believe this is impossible, especially in light of compiled C extensions. > It's fun to think about, but soooo far beyond my skills ;_; Probably beyond *anybody's* skills in the case of Ruby. :-) Kind regards robert -- use.inject do |as, often| as.you_can - without end