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

@varnames_interface: warn or even reject duplicate variable names? #1761

Open
fingolfin opened this issue Jul 29, 2024 · 1 comment
Open

Comments

@fingolfin
Copy link
Member

It probably isn't a good idea to use the same variable names multiple times, like here:

julia> polynomial_ring(QQ, :x=>1:2, :x=>1:3)
(Multivariate polynomial ring in 5 variables over QQ, QQMPolyRingElem[x[1], x[2]], QQMPolyRingElem[x[1], x[2], x[3]])

Should we catch this and either print a warning, or outright error? My guess is that this mostly happens due to user error (e.g. a typo changing y to x)

It would be easy enough to do by inserting an allunique call in a suitable spot. Of course that in turn slows down things.

If we decide against it, perhaps we should at least insert a warning comment in the polynomial_ring docstring that this is not checked for?

@lgoettgens
Copy link
Collaborator

I am in favor of adding an allunique check. This shouldn't be the bottleneck for any of the use cases.

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