True, but that requires writing an additional definition and hides the parameter types, which can be very interesting, and you'd need a typedef for every new param combination I guess. It feels like a solution for a problem that could have been avoided by a better signature syntax in the first place.
I don't think it's that uncommon. Let's say you have a function that handles a request. A common use case is to add permission checks before applying that function. You can write a generic permission check a bit like this:
This would allow you to separate the permission check logic from the business logic. Though to be fair, in Go they prefer to keep things as simple as possible but it's just to illustrate that these concepts are not that alien.
Go's syntax is vastly superior once you have more complicated signatures, then the left-to-right truly matters. For example a variable that contains a pointer to a function that takes a function and an int and returns another function (like a decorator).
In C the order becomes very hard to understand and you really have to read the thing several times to understand the type of fp:
int (*(*fp)(int (*)(int, int), int))(int, int)
In Go, you can just read from left to right and you can easily understand what f's type is:
How about you travel there and bring whatever you have?
Or maybe just start by reflecting why you even felt the need to state your original comment and think 'yeah this is a nice and productive thing to say, that will help for sure'.
It seems like easy talk to imply people in Africa can just go die of thirst as you think their water now belongs to the elephants, all from the comfort of your chair thousands of kilometers away while your country is contributing a thousand times more to the destruction of the world than they ever will. And I can state this with fair certainty as pretty much every country in the world is doing worse. What was even the point of your comment? How about you give them your water as they deserve it more?
True, but that requires writing an additional definition and hides the parameter types, which can be very interesting, and you'd need a typedef for every new param combination I guess. It feels like a solution for a problem that could have been avoided by a better signature syntax in the first place.