promise::finalize_anonymous(): rename, remove or rewrite

Issue #63 resolved
Dan Bonachea created an issue

As currently defined, promise::finalize_anonymous() is semantically identical in every way to promise::fulfill_anonymous(1). However, the reader has to visually diff the paragraph of semantics describing each to discover this equivalence. There's also a design question of why we feel the need to have two different names for semantically equivalent methods (especially since they are close enough to breed confusion).

I see three possible resolutions:

  1. Rename promise::finalize_anonymous() to promise::fulfill_anonymous(void), ie make it a zero-argument overload for the method which shares its semantics.

  2. Remove the superfluous promise::finalize_anonymous() entirely, and instead add a default of 1 to the count value of promise::fulfill_anonymous(count). This one remaining method can then be used with or without argument to achieve all the same behavior as currently.

  3. If we insist on keeping the superfluous promise::finalize_anonymous() method as sugar, then we should change its documentation to explicitly clarify it is sugar. Ie replace the entire semantics with something like:

    Equivalent to this->fulfill_anonymous(1)

Options 1 or 2 could also rename the one unified name to a new unified name if that makes sense.

Comments (1)

  1. Log in to comment