Skip to content

Conversation

@zth
Copy link
Member

@zth zth commented Jul 3, 2025

Also mostly AI written, but again seems good.

#7546

@pkg-pr-new
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
Member 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
Member 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
@fhammerschmidt fhammerschmidt mentioned this pull request Oct 22, 2025
28 tasks
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.

4 participants