Hacker News new | past | comments | ask | show | jobs | submit login

> println() is not Iron request handler, you gave wrong example. Signature matters.

println is not relevant here it only shows the result of the call, the point is that you can use a method as a function, I expect the issue is elsewhere (but not having used Iron, I wouldn't know where).

> I don't see how you can declare field if structure to have default value 65535, even with Default trait.

Implement Default then call it when instantiating struct: http://is.gd/2YSoKd

> I posted opinion not to argue and really frustrating to see downvotes for opinion. Make discussion more constructive.

Er… I didn't downvote you? I just replied to some of your objections which I assume is what you expected?




> Implement Default then call it

It's far from "default values in struct declaration". I mean this:

struct X { i:u32 = 5, j:u64 }


> the point is that you can use a method as a function

And still: no. When signature is declared strictly (and in reality it's all cases except println and format), you can pass only function with matching signature. self/&self changes signature.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: