Duby dynamic dispatch has landed!
Attila Szegedi
szegedia at gmail.com
Thu Mar 25 10:18:27 PDT 2010
Also worth noting is that if you specify a specific return type (i.e. boolean) at the call site, MOP will ensure that whatever method ends up invoked, the return value is converted (either using built-in JVM conversions, or even your own language-specific ones if you provide a GuardingTypeConverterFactory implementation).
Attila.
On 2010.03.25., at 18:13, Charles Oliver Nutter wrote:
> On Thu, Mar 25, 2010 at 10:12 AM, Rémi Forax <forax at univ-mlv.fr> wrote:
>> I've also found useful to propagate expected type back to the calling
>> method.
>> Example:
>> if (foo()) { ... }
>>
>> should be translated to indy foo ()Z instead of ()Object because if ()
>> wait for a boolean.
>
> Yeah, I suppose this is appropriate for any "call" that is seen to be
> receiving a dynamic type, i.e.:
>
> def foo(a:List, b:dynamic)
> a.get(b.size) # size should be indy size()I
>
> I'll have to see what I'd need to do in Duby's type engine to have
> "upstream" type requirements influence "downstream" inferred types.
>
> - Charlie
More information about the mlvm-dev
mailing list