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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up the design of Char #299

Open
bobzhang opened this issue Apr 21, 2024 · 0 comments
Open

clean up the design of Char #299

bobzhang opened this issue Apr 21, 2024 · 0 comments
Assignees

Comments

@bobzhang
Copy link
Contributor

Char is a unicode code point in MoonBit, it is encoding agnostics, it is not tied to utf16, so we should not provide APIs like this:

fn Char::is_surrogate(Char) -> Bool

We should provide String.as_iter which returns Iter[Char]

鈥淎馃槉馉B"
   .as_iter()
   .reduce(init=Vec::[], fn {acc, x -> acc.push(x)})
// expected output
[65, 128522, 134071, 66]

cc @yj-qin

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

No branches or pull requests

2 participants