From: Robert Feldt Date: 2001-12-12T00:12:51+09:00 Subject: [ruby-talk:28227] Re: The benefits of dynamic typing? On Tue, 11 Dec 2001, Michael Cook wrote: > >> This post offers good coverage of all sides of the issue - could you post > >> it to the RubyDiscussions section of the wiki on Rubygarden.com? > >> > > Ok, check out > > > > http://www.rubygarden.org/ruby?DynamicVsStaticTyping > > it doesn't seem unreasonable that a language should support both > static and dynamic typing. then, if i knew at compile time what the > types would be, i could tell the compiler, and i could possibly > expose some problems at compile time. but if i didn't know the > types at compile time, that would be okay too. > This is how Dylan does it. In RubyVM I've been thinking of allowing such type hints either at compile time or when you write your methods. Something like class T type_hint Integer, :m, Integer, Integer def m(a,b) a+b end end when you write the method or if the type_hint above wasn't given in the source it could be specified in a separate file and given to the compiler. Regards, Robert Feldt