-
Notifications
You must be signed in to change notification settings - Fork 231
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
Add toExternalString(MutableMatrix) #3362
Add toExternalString(MutableMatrix) #3362
Conversation
The error message was essentially the same for mutable lists and mutable hash tables, so we combine them. We also drop toExternalString(Type), since Type is a subclass of MutableHashTable, and we can just use inheritance.
We just use the same method as we use for mutable lists and hash tables.
e5595a1
to
e82f71d
Compare
I've re-written this so that Beforei1 : toExternalString new SelfInitializingType of HashTable
stdio:1:1:(3): error: anonymous type cannot be converted to external string
i2 : toExternalString mutableMatrix {{0}}
stdio:2:1:(3): error: can't convert local symbol or invisible global symbol 'RawMutableMatrix' to external string
null: here is the first use of 'RawMutableMatrix' Afteri1 : toExternalString new SelfInitializingType of HashTable
stdio:1:1:(3): error: anonymous self initializing type cannot be converted to external string
i2 : toExternalString mutableMatrix {{0}}
stdio:2:1:(3): error: anonymous mutable matrix cannot be converted to external string |
Looks good. Mind if I send in a couple of commits, clearing up unnecessary toExternalString methods for different types of rings? |
Go for it! |
Now we have: i1 : select(methods toExternalString, m -> ancestor(MutableHashTable, m#1))
o1 = {0 => (toExternalString, Monoid) }
{1 => (toExternalString, MutableHashTable)}
{2 => (toExternalString, Ring) }
{3 => (toExternalString, Variety) } But among these, the mutable hash table one is just an error: i3 : code o1#1
o3 = -- code for method: toExternalString(MutableHashTable)
../../Macaulay2/m2/nets.m2:73:39-76:43: --source code:
toExternalString MutableList := s -> (
if hasAttribute(s,ReverseDictionary)
then toString getAttribute(s,ReverseDictionary)
else error("anonymous ", synonym class s, And the other three are convenient exceptions because you can make a matrix, list, or hash table immutable, but you can't turn a monoid, ring, or variety immutable. Tangentially:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this. If the changes I added are okay, feel free to merge!
Related: have you seen #1026? |
Before
After