Skip to content

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

Open
@smarr

Description

@smarr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    specNeeds specification, or is specification related.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions