|
|
|
|
|
by twic
86 days ago
|
|
I think we need to see a few non-contrived examples, because i think in every case where you might take advantage of currying like this, you actually want to make it explicit, as you say. The flip side of your example is that people see a function signature like getClosest, and think it's fine to call it many times with a set and a point, and now you're building a fresh quadtree on each call. Making the staging explicit steers them away from this. |
|
Irrespective of currying, this is a really interesting point - that the structure of an API should reflect its runtime resource requirements.