This would make function signatures harder to read in some instances,
particularly when using closures and higher-order functions:
let f: fn(T): T = …;
fn hof<T>(x: T, f: fn(T): T): fn(T): T { … }
Compare to the current syntax:
let f: fn(T) -> T = …;
fn hof<T>(x: T, f: fn(T) -> T) -> fn(T) -> T { … }
~Brendan
On 30/07/2013, at 9:29 AM, Wojciech Miłkowski <[email protected]> wrote:
> Hi,
>
> I'm observing rust development for some time, and I must say it slowly
> encourages me to use it. Especially the progress from Perl-like syntax
> to more sane and quiet form is enjoyable.
> That said I wonder why the function definition has form:
> fn name(var: type, ...) -> return_type {...}
> instead of more unified:
> fn name(var: type, ...): return_type {...}
>
> Is it constructed to mimic mathematical form f(x)->y or is there other
> reason i.e. syntax ambiguity?
>
>
> Cheers,
> W.
> _______________________________________________
> 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