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

feat(stdlib): Add addCharFromCodePoint to Buffer module #1883

Merged
merged 6 commits into from
Aug 20, 2023

Conversation

spotandjake
Copy link
Member

@spotandjake spotandjake commented Jul 15, 2023

This add Buffer.addCharFromCodePoint to the Buffer module, this is used in #1133. This is very similar to doing:

Buffer.addUint32(Char.code('a'))

but it handles the correct byte count of chars.

Internally I chose to just call addChar this leaves less surface area for bugs to crop up, and given char is a stack type we are not giving up a ton of perf. Well once #1879 is completed.

stdlib/buffer.gr Outdated Show resolved Hide resolved
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

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

Doc could use some work

stdlib/buffer.gr Outdated Show resolved Hide resolved
stdlib/buffer.gr Outdated Show resolved Hide resolved
@phated phated changed the title feat(stdlib): Add addCharFromCodePoint to buffer feat(stdlib): Add addCharFromCodePoint to Buffer module Aug 20, 2023
@phated phated added this pull request to the merge queue Aug 20, 2023
Merged via the queue into grain-lang:main with commit 18b553a Aug 20, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants