Open
Description
I think System>>#global:put:
should probably return the value that is now stored in the globals.
This would be consistent with Array>>#at:put:
returning the new value.
It seems like a sensible guideline for all core library mutators of this kind to return the value, so that if it was computed from an expression, it can be used further immediately. Other options such as self
or nil
seem to be less useful. Returning the old value might be another option, but seems to be inconsistent with the general philosophy, and unexpected from the naming.
System>>#globals:put:
returning nil
was identified here softdevteam/yksom#90 (comment) by @ummarikar.
Todo for Spec
- add tests for
System>>#globals:put:
returning the value, and testing a range of values - add a design guidelines section for core lib to this effect, including simple examples/tests