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

Should namespace be library_name or something? #589

Closed
robertbastian opened this issue Jul 23, 2024 · 3 comments
Closed

Should namespace be library_name or something? #589

robertbastian opened this issue Jul 23, 2024 · 3 comments

Comments

@robertbastian
Copy link
Collaborator

We don't support nested namespaces afaik, and so far we're using it as what basically is the library name (e.g. icu4x). If we called it library name, it could also be useful for Dart, maybe JS, Kotlin, and C (as a prefix).

@Manishearth
Copy link
Contributor

We don't support nested namespaces afaik

We absolutely do, it's just not polished: in C++ you can do namespace = "foo::bar" and it works. I'd like other backends to support that in the long run, it's useful to be able to further organize your code. It's not been priority for me to do this because ICU4X doesn't need it.

Most likely it would be the syntax of namespace = "foo::bar" or namespace = "foo.bar" and the code automatically detects the syntax and transforms it to the appropriate convention.

Now that I think about it more I think #572 might have broken this. But I do intend to have this functionality in here, aspirationally. Filing a separate issue.

@Manishearth
Copy link
Contributor

Filed #591 for nested namespaces. I do think library_name and namespace are somewhat separate features that likely interact strongly: for ICU4X's purpose so far namespace is serving its purpose but I think being able to set the library name from the config would be really really nice, and we can then have namespacing on top of that for code organization (e.g. to do icu4x::properties::CodePointSet if we ever decide to)

@Manishearth
Copy link
Contributor

Closing in favor of #688

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