Add a new token to force the methods to returns the previous object

Don’t see this feature as a reason for people to neglect good API choices; see its use as a signal that you should rethink your API, and if there’s no other way, it’s okay to use it as a last resort.

I left the advantages listed in the gist above, but I’ll mention them here:

  1. Suggesting improvements for APIs often takes a long time to be accepted, and even then there’s a chance they’ll be rejected, making the process even more time-consuming;
  2. You are no longer required to create temporary variables in order to avoid losing the reference;
  3. Avoid creating custom utilities or subclasses to work around the problem.
  4. It can serve as a metric to indicate a poor API;
  5. You are not dependent on API maintainers because it works with any method; ~ @jsbueno
  6. It is moderately readable and intuitive, much more so than solutions with := + or, and much more concise.
  7. Since the API remains unchanged, it does not break compatibility with previous versions; ~ @jsbueno
  8. More incentive for creating methods that modify only the class state, so they can focus solely on functionality; ~ @jsbueno