Skip to content

Docstrings for ArrayBuffer #7594

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

Merged
merged 3 commits into from
Jul 3, 2025
Merged

Docstrings for ArrayBuffer #7594

merged 3 commits into from
Jul 3, 2025

Conversation

zth
Copy link
Collaborator

@zth zth commented Jul 3, 2025

Also mostly AI written, but again seems good.

#7546

Copy link

pkg-pr-new bot commented Jul 3, 2025

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7594

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7594

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7594

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7594

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7594

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7594

commit: 09f1172

@zth zth marked this pull request as ready for review July 3, 2025 14:19
@zth zth requested a review from cknitt July 3, 2025 14:19
ArrayBuffer.byteLength(sliced) == 8
```
*/
@send external sliceToEnd: (t, ~start: int) => t = "slice"
Copy link
Member

@cknitt cknitt Jul 3, 2025

Choose a reason for hiding this comment

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

Just realized: Do we actually need this? Can't we just make ~end optional in slice instead?

Same for Array.sliceToEnd, String.sliceToEnd.

Actually start is also optional according to MDN.

So I think we should have the signature

@send external slice: (t, ~start: int=?, ~end: int=?) => t = "slice"

and deprecate sliceToEnd.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good! I'll fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 09f1172

Copy link
Member

Choose a reason for hiding this comment

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

Thanks a lot! Would you also create PRs for Array, String etc.?

@zth zth requested a review from cknitt July 3, 2025 18:14
@zth zth merged commit 14f388b into master Jul 3, 2025
17 checks passed
@zth zth deleted the stdlib-arraybuffer-docstrings branch July 3, 2025 19:16
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