Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Compiler should catch name collision between package and file name #6

Closed
janicedatawire opened this issue Oct 5, 2015 · 3 comments
Closed

Comments

@janicedatawire
Copy link
Contributor

The package name and the quark file name must be different. The compiler currently allows them to be the same - it should check and throw an error in this case.

@ark3
Copy link
Contributor

ark3 commented Oct 28, 2015

To clarify, the package name (package henry { ... }) and the quark filename (henry.q) must be different only if the quark file contains code that is not in a package. In the JS and Python backends, that non-package code ends up in a target file named after the quark filename (henry.js and henry.py), which makes importing the package (in henry/index.js and henry/__init__.py) conflict with importing the non-package code.

The compiler could detect this scenario and then complain unconditionally, as specified above, but it might be nicer not to complain if there is no non-package code and thus no conflict. I like the idea of defining a package called directory in a file called directory.q.

@bozzzzo
Copy link
Contributor

bozzzzo commented Jul 21, 2016

@ark3 this sounds like fixed in recent quark?

@ark3
Copy link
Contributor

ark3 commented Jul 21, 2016

Quark no longer has non-namespace code. All code lives in some named namespace, so the above is no longer an issue.

@ark3 ark3 closed this as completed Jul 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants