I would note that Rust macros are actually working with structural typing:
the expanded macro cannot be compiled unless the expressions/statements it
results in can be compiled.

Regarding Scala here, it seems a weird idea to ask that each and every
method should copy+paste the interface. We all know the woes of duplication.

Instead, you can define a Trait (even if for a single function) and it'll
just work; and when you add a second function you will be able to re-use
the same trait.


On Sun, Mar 23, 2014 at 11:37 AM, Liigo Zhuang <[email protected]> wrote:

> IMO, this is bad.
> 2014年3月23日 下午6:34于 "Ziad Hatahet" <[email protected]>写道:
>
>> Hi all,
>>
>> Are there any plans to implement structural typing in Rust? Something
>> like this Scala code: http://en.wikipedia.org/wiki/Duck_typing#In_Scala
>>
>>
>> _______________________________________________
>> Rust-dev mailing list
>> [email protected]
>> https://mail.mozilla.org/listinfo/rust-dev
>>
>>
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to