Hi,

Am 02.08.2012 um 22:00 schrieb Tim Chevalier <[email protected]>:

> 
> You may be able to use traits and impls to overload the name a, but if
> you don't mind giving the different functions different names, this
> way doesn't require any fancy ideas.
> 

I keep wondering if we should have a way to specify a default value per type, 
perhaps via a specific trait that just provides a default() call (e.g. none for 
option).  This way optional arguments could be implemented with a simple rule: 
All missing arguments are replaced with calls to default() if the type 
implements that.

Cheers,


Stefan.



_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to