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

Add array[E], hash[K,V] and documents most interfaces #1455

Conversation

sampersand
Copy link
Contributor

@sampersand sampersand commented Aug 22, 2023

This adds the array[E] = Array[E] | _ToAry[E] and hash[K, V] = Hash[K, V] | _ToHash[K, V] types, as well as adds documentation to all _To* interfaces and all type declarations within builtin.rbs

@sampersand sampersand force-pushed the swesterman/23-08-22/document-builtins-and-add-hash/array branch from 9a59065 to 8797d82 Compare August 22, 2023 20:58
@sampersand sampersand changed the title This adds array[E], hash[K,V] and documents most interfaces Add array[E], hash[K,V] and documents most interfaces Aug 22, 2023
@ParadoxV5
Copy link
Contributor

I would rather like to know the purposes of int, string and io besides one word beïng prettier than _ToXXX.

@sampersand
Copy link
Contributor Author

I would rather like to know the purposes of int, string and io besides one word beïng prettier than _ToXXX.

I talked with soutaro last night about this actually. The idea is that while technically redundant, they exist for documentation purposes: If you accept string x, that means the cannonical case is accepting a String, but it also can accept a .to_str if needed. Compare to if you just accept _ToStr, that implies that you generally want a class that defines .to_str.

So the idea is, in the stdlib, you always want to use int / string / io and friends

@soutaro soutaro force-pushed the swesterman/23-08-22/document-builtins-and-add-hash/array branch from 8797d82 to 0a7aaa5 Compare August 29, 2023 01:48
Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

👍

@soutaro soutaro enabled auto-merge August 29, 2023 01:48
@soutaro soutaro added this to the RBS 3.3 milestone Aug 29, 2023
@soutaro soutaro added this pull request to the merge queue Aug 29, 2023
Merged via the queue into ruby:master with commit da1534f Aug 29, 2023
23 checks passed
@soutaro soutaro added the Released PRs already included in the released version label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

3 participants