Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System>>#global:put: should return value #25

Open
2 tasks
smarr opened this issue Jan 25, 2020 · 0 comments
Open
2 tasks

System>>#global:put: should return value #25

smarr opened this issue Jan 25, 2020 · 0 comments
Labels
spec Needs specification, or is specification related.

Comments

@smarr
Copy link
Member

smarr commented Jan 25, 2020

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
@smarr smarr added the spec Needs specification, or is specification related. label Jan 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Needs specification, or is specification related.
Projects
None yet
Development

No branches or pull requests

1 participant