Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stdlib: add DataView with littleEndian get/set#7881

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
cknitt merged 11 commits intorescript-lang:masterfromhtoooth:feat/dataview
Sep 16, 2025

Conversation

@htoooth
Copy link
Contributor

No description provided.

@pkg-pr-new
Copy link

pkg-pr-newbot commentedSep 12, 2025
edited
Loading

Open in StackBlitz

rescript

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

@rescript/darwin-arm64

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

@rescript/darwin-x64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/runtime

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

@rescript/win32-x64

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

commit:ea0573f

@cknitt
Copy link
Member

@htoooth Thank you for your contribution! 👍

Instead of two bindings per function like

@sendexternalgetInt16: (t,int)=>int="getInt16"@sendexternalgetInt16LittleEndian: (t,int, @as(1)_)=>int="getInt16"

could you do single bindings like

@sendexternalgetInt16: (t,int, ~littleEndian:bool=?)=>int="getInt16"

please?

(Bonus points for adding doc strings with tests/code examples 🙂.)

@htoooth
Copy link
ContributorAuthor

htoooth commentedSep 12, 2025
edited
Loading

@cknitt

  1. I did it this way because I saw that's how it was done in the previous v11.
  2. The idea of encapsulating polymorphic functions mentioned in the document is also to encapsulate for different situations.
  3. This makes it easier to migrate old code.

By the way, I also initially thought of adding a parameter like your said@cknitt

Where to add tests and documentation? I couldn't find the previous documents and test cases

@cometkim
Copy link
Member

Using@as(1) _ here is neat btw

@cknitt
Copy link
Member

cknitt commentedSep 12, 2025
edited
Loading

I did it this way because I saw that's how it was done in the previous v11.

In previous ReScript versions, the approach with the optional argument was not really ergonomic because a trailing unit argument was required.

Now that it has become feasible, we have moved to single bindings in the stdlib where possible, as this is much clearer to JS devs, basically resulting in a 1:1 correspondence with the JS APIs as documented on MDN.

E.g.Float.toString with optional parameterradix, deprecatingFloat.toStringWithRadix. There are many more such examples in the new stdlib.

Therefore, also theDataView bindings should follow suit.

Docstrings are in a corresponding .resi file and contain examples that are automatically verified as test assertions during the CI build.

Example:

`toString(v)` return a `string` representing the given value.

htoooth reacted with thumbs up emoji

@htoooth
Copy link
ContributorAuthor

@cknitt I have made the revisions and added the doc.

Copy link
Member

@cknittcknitt left a comment

Choose a reason for hiding this comment

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

Thanks!
CI does not build yet though.

@htoooth
Copy link
ContributorAuthor

htoooth commentedSep 15, 2025
edited
Loading

@cknitt

imageimage

CI in Windows is passed, but others are not.
I ran 'make format', but nothing changed.
Can you help me?

@htoooth
Copy link
ContributorAuthor

@cknitt I have passed the CI

@cknitt
Copy link
Member

@htoooth Looks great now! One last thing - could you add a CHANGELOG entry, please?

@htoooth
Copy link
ContributorAuthor

@htoooth Looks great now! One last thing - could you add a CHANGELOG entry, please?

done

@cknittcknitt merged commit1bef891 intorescript-lang:masterSep 16, 2025
25 checks passed
@fhammerschmidtfhammerschmidt mentioned this pull requestOct 22, 2025
28 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cknittcknittcknitt approved these changes

@cometkimcometkimAwaiting requested review from cometkim

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@htoooth@cknitt@cometkim

[8]ページ先頭

©2009-2025 Movatter.jp