From: gabriele renzi Date: 2004-12-02T06:12:45+09:00 Subject: Re: Thoughts on Typing Hints (Re: Optional static typing (or, What can Ruby 2.0 borrow from Boo?)) Austin Ziegler ha scritto: > I don't like that because it then suggests that this should be > possible: > > def foo(String s, Hash h) > end > > def foo(Integer s, Hash h) > end > > This seems to regress from what I have come to know and love in > Ruby. well, but is'nt multimethod dispatch something useful ? I'm thinking of cases like: class Foo def initialize(foo) case foo when Integer do stuff when String do other stuff end end end which is inextensible withouth changing the method source, while with MMD a specialized method can be provided from anyone. Not that this needs a special syntax, as florian gross demonstrated some time ago :) > I don't see great value in type hinting -- and static typing is a > big lose in Ruby, I think (type inferencing, on the other hand, is > valuable). This might actually be something that can be done, and > done without really harming the flexibility of Ruby. static automagic interface inference yay!