Use `getindex` for vector creation
Now ZZ[1, 2, 3, 4] should create a vector. Still allows for getting generators via S[i]. Will be overloaded with specific methods since this is very generic.
Solves #2052
Isn't R[1] ambiguous? And what about R[:x]?
Isn't
R[1]ambiguous?
Yes, but it will always default to gens(R, 1).
And what about
R[:x]?
It will still work as VarName is stricter than Any.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 88.36%. Comparing base (2479164) to head (acc4fd3).
:warning: Report is 120 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #2053 +/- ##
=======================================
Coverage 88.36% 88.36%
=======================================
Files 125 125
Lines 31551 31552 +1
=======================================
+ Hits 27880 27881 +1
Misses 3671 3671
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Isn't
R[1]ambiguous?Yes, but it will always default to
gens(R, 1).
It is still very unintuitive for users. And as far as I can see, the syntax does not allow to create singleton vectors. (What about empty vectors?)
Thank you @albinahlback . If we started from scratch, I'd like to have this; but due to the history and existing features, unfortunately this is not something we feel we should add to Nemo.
Note that one can do ZZ.([1,2,3,4]) which is slightly less efficient and slightly longer but for interactive use hopefully "good enough".