-
Notifications
You must be signed in to change notification settings - Fork 4
Description
(BG-local 6)
Most of the Promise function names are worded as observer functions, yet none of them are!
Example: unhandled_exception reads exactly the same as uncaught_exception(s), already in the standard library!
This will create confusion in people learning the API, as the same naming style is reused with a different meaning.
Proposed change:
Mark functions, which are user implementations of required behavior, with an "on_" prefix. unhanded_exception becomes on_unhanded_exception, return_value becomes, on_return_value, return_void becomes on_return_void, yield_value becomes on_yield_value.
This naming might seem novel, but the API itself is quite different from the rest of the Standard Library already. The fact that, for example, yield_value does not actually return the yielded value, the way std::begin does, is already a stark enough contrast that calls for different naming.
Note: await_transform is a special, optional case and should be let as it is, unless the Committee decides otherwise.