Skip to content

Rename IReadOnlyList.add to trySetItem - #205

Merged
gusty merged 2 commits into
fsprojects:masterfrom
wallymathieu:rename-readonly-add
Dec 17, 2019
Merged

gusty merged 2 commits into
fsprojects:masterfrom
wallymathieu:rename-readonly-add

Conversation

@wallymathieu

Copy link
Copy Markdown
Member

Also added some documentation while at it

@gusty gusty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at its signature, the name should be something with try.

I think trySetItem would align well.

@gusty

gusty commented Dec 7, 2019

Copy link
Copy Markdown
Member

I'm still not sure which one aligns better: trySetItem or trySetValue.

I'm gathering evidence of actual naming to see which one is the de-facto standard.

@wallymathieu

Copy link
Copy Markdown
Member Author

Good question, there are some merits to both. Though tryItem is already declared on the module, why perhaps we should rename both in that case

@cannorin

cannorin commented Dec 9, 2019

Copy link
Copy Markdown
Member

The intuition behind the naming of tryItem would be get_Item and set_Item, so I think try{Get,Set}Item is the best option. But since there are so many item/tryItem already in the library, it might not worth renaming all of them to getItem/tryGetItem.

@wallymathieu

Copy link
Copy Markdown
Member Author

Yes, tryGetItem would be neat to have.

@gusty gusty changed the title Rename IReadOnlyList.add to setItem Rename IReadOnlyList.add to trySetItem Dec 17, 2019
@gusty
gusty merged commit 33fa341 into fsprojects:master Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants