# Auto-currying in Rust

**URL:** <https://internals.rust-lang.org/t/auto-currying-in-rust/149>\
**Category:** ideas (deprecated)\
**Created:** [July 15, 2014, 2:58am UTC](https://internals.rust-lang.org/t/auto-currying-in-rust/149 "2014-07-15T02:58:55Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![dobkeratops](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/dobkeratops/32/4577_2.png) [@dobkeratops](https://internals.rust-lang.org/u/dobkeratops)\
**Post date:** [July 18, 2014, 12:32am UTC](https://internals.rust-lang.org/t/auto-currying-in-rust/149/22 "2014-07-18T00:32:09Z")

</div>

> addNewControl("New", 50, 20, 100, 50); What does that mean? Types don't help, it's just &str, int, int, int, int

agree that the named arguments are a nice solution here (which is why i like the python idea, you get the ability to annotate with names routinely)... .. but with the C++ overloading, you can "say it with types". How about..

addNewControl("New", Point2d(50,20), Size2d(100,50))

'addNewControl' could have all sorts of overloads, - e.g. omit the 'size', and you expect it to figure it out itself. Omit position, and you expect it to place somewhere sensible in the parent window.

Its funny how divisive this is. I've seen people argue _against_ keyword args claiming that leveraging types is superior. (You're creating more semantics the compiler understands) - but I don't see them as mutually exclusive. I'd like both

> Also, not sure why you want =\> instead of the simpler and clearer =.

that doesn't fit in rusts' grammar already; = can be used within expressions. (but it returns () unlike c++.. not sure of the use)

---

_[View the full topic](https://internals.rust-lang.org/t/auto-currying-in-rust/149)._
