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

"char": implement "is_whitespace" and "maybe_digit" using "std::unicode::icu" #1371

Closed
kud1ing opened this issue Dec 22, 2011 · 7 comments
Closed

Comments

@kud1ing
Copy link

kud1ing commented Dec 22, 2011

"is_whitespace" and "maybe_digit" should be implemented using the libicu binding in module "std::unicode::icu".
libicu is battle tested, we should not replicate their effort.

See #1370

@boggle
Copy link
Contributor

boggle commented Dec 22, 2011

Both these tickets require that unicode.rs (and linking against libicu) is moved to core (which we try to keep small). Then again, the contents of libcore is not final yet (c_vec, dbg coming to mind).

@kud1ing
Copy link
Author

kud1ing commented Dec 22, 2011

I sympathize with this goal.

Currently we pretend to do unicode in libcore, but it's really only the ASCII-subset.
Maybe we should organize it like this:

  • libcore:
    • std::ascii
  • libstd:
    • std::unicode
    • std::char (decides wether to use std::ascii or std::unicode)
    • std::str (decides wether to use std::ascii or std::unicode)

D performes similar decisions in their std.string: https://github.com/D-Programming-Language/phobos/blob/master/std/string.d

The downside is a duplication of functions/interfaces.

@boggle
Copy link
Contributor

boggle commented Dec 22, 2011

If one wants to do ASCII, one can always use [u8]. Arguably vecs need better support in core (sub"string" functions and the like). char is defined to be a unicode char. core is - to my understanding - loosely defined to hold all that is absolutely necessary to make sensible use of built in primitives. So char and unicode should move to core, I guess.

@kud1ing
Copy link
Author

kud1ing commented Dec 22, 2011

I think the type "str" is not defined in module "str". Is it a bultin-in?
I am not sure, we need "char" and "str" in libcore at all.

@boggle
Copy link
Contributor

boggle commented Dec 22, 2011

I think they are both built in and thus support code for them should go to libcore. Maybe graydon can decide this?

@kud1ing
Copy link
Author

kud1ing commented Dec 22, 2011

Sorry, i meant: I am not sure, we need the modules "char" and "str" in libcore at all.

@kud1ing
Copy link
Author

kud1ing commented Dec 24, 2011

"is_whitespace" is implemented in ac13f0d according to the script-proposal in #1348

@kud1ing kud1ing closed this as completed Dec 24, 2011
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
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