-
Notifications
You must be signed in to change notification settings - Fork 63
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
: handle polynomial_ring(QQ, :x => 3)
better
#1759
Comments
polynomial_ring(QQ, :x => 3)
better@varnames_interface
: handle polynomial_ring(QQ, :x => 3)
better
The complicated case is something like The two ways I see here: |
I think allowing |
I thought I have seen this in a doctest somewhere in |
Just found AbstractAlgebra.jl/src/misc/VarNames.jl Line 19 in 6be27f6
in a related docstring. This currently documents 2.ii., although it does not work. |
Right now
polynomial_ring(QQ, :x => 3)
leads to an error that is not very helpful:I'd like to improve this. The two major options are:
polynomial_ring(QQ, :x => 1:3)
polynomial_ring(QQ, :x => 3:3)
The fact that there are at least two interpretations might suggest we should prefer the error. Then again I am not sure how natural each is? For me I comparatively often make this mistake because I think "I want three x-variables", so I use
:x => 3
when I really mean:x => 1:3
. The only reason I am considering the other option is that it is based on Julia semantics: one can "iterate" over an integer, and the integer is treated as if it was a 0-dimensional container with a single entry (itself). Honestly I don't like this, but it is what it is, so one might just lean into it...Still the safe route would be 1. An error can always be turned into working code later on.
Any thoughts on this?
The text was updated successfully, but these errors were encountered: