Feature #1290
NewPolyRing: allow symbols with just head and no indices?
Description
It seems superfluous to have to specify an empty list of indices if one wants no indices; should we allow the indices
field to be absent (treated as if it were an empty list)?
>>> NewPolyRing(QQ, [record[head:="alpha", indices:=[]]]); RingWithID(3, "QQ[alpha]") >>> NewPolyRing(QQ, [record[head:="alpha"]]); --> ERROR: record must have "head" and "indices" fields --> NewPolyRing(QQ, [record[head:="alpha"]]); --> ^^^^^^^^^^^^^^^^^^^^^^^
Related issues
History
#1 Updated by John Abbott almost 5 years ago
- Related to Bug #1273: NewPolyRing and SymbolRange together make a crash added
#2 Updated by John Abbott almost 5 years ago
The manual page for NewPolyRing
could be improved (and made shorter).
I find the discussion about ::=
to be an unhelpful distraction (at least, in its current position).
#3 Updated by Anna Maria Bigatti almost 5 years ago
I agree: ok for treating "no indices" as "empty indices".
#4 Updated by Anna Maria Bigatti almost 5 years ago
John Abbott wrote:
The manual page for
NewPolyRing
could be improved (and made shorter).
I find the discussion about::=
to be an unhelpful distraction (at least, in its current position).
This should be another issue. Nothing to do with head and indices ;-)
#5 Updated by John Abbott almost 5 years ago
- Status changed from New to Resolved
- Assignee set to John Abbott
- % Done changed from 0 to 70
I have modified the fn evalArgAsListOfSymbols
so that it accepts records with just a head
field and no indices
field.
The code does not check whether there are any other fields -- if present, they are silently ignored.
I have added a single test (actually in exbugs.cocoa5
).
Doc still needs to be updated.
#6 Updated by Anna Maria Bigatti over 4 years ago
It works now. (both Mac and Linux)
However, NewPolyRing(QQ, "alpha");
is better, isn't it? ;-)
Close?
#7 Updated by John Abbott over 4 years ago
Yes, NewPolyRing(QQ, "alpha")
is cleaner, simpler, etc.
But if you want to specify several symbols, some of which have indices and some don't...
NOTE (2020-02-15) JAA no longer understand what this comment is about it --> ignore it?
#8 Updated by John Abbott about 4 years ago
- Status changed from Resolved to Closed
- % Done changed from 70 to 100
- Estimated time set to 0.99 h
This seems to work fine now. The manual page needs cleaning; but I'll make a separate issue.
Closing.