-
Notifications
You must be signed in to change notification settings - Fork 90
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
File name containing period cannot be converted into a valid namespace name #1796
Comments
This is not actually true anymore (as of #493), as If, e.g. To accomplish your scenario with implicit filesystem namespaces, you can either use explicit namespaces, or you can have a file |
Should we update documentation to mention this? Right now it says the opposite
The issue here is not that I cannot find a way to define a namespace with a dot in it. The issue is that I create a valid file that should be converted to a valid namespace name, and it errors out instead. In the past we had plenty of different files that defined parts of the same namespace, it is not a problem at all. To give you just one example written by an external user (without my input), https://github.com/Strilanc/quantum-block-lookahead-adder/tree/master/anc/src has Q# code in multiple files, all of it in one namespace |
We did move away from re-opening namespaces as a pattern with the introduction of implicit filename-based namespaces. This was intentional, as we don't want you to be able to re-open a file-based namespace and add items to it -- it is confusing, and can lead to spaghetti code. We want to maintain that a file is the canonical source for items defined within that namespace. We do not want the situation where What I've just said is only the case when using the newly-introduced implicit namespaces. For explicit namespaces, existing behavior still works (that is, this change wasn't breaking). You can still create a new file and explicitly define a namespace |
Describe the bug
Expected behavior
Q# supports namespaces with periods, and file systems support file names with periods, so I expect a namespace to be generated successfully. Personally, I like to place my main code in namespace called "Topic" and test code - in the namespace "Topic.Test", and it would be great to do that while taking advantage of the new feature on omitting explicit namespace declarations.
System information
The text was updated successfully, but these errors were encountered: