-
Notifications
You must be signed in to change notification settings - Fork 258
promote cleanup #3903
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
base: development
Are you sure you want to change the base?
promote cleanup #3903
Conversation
M2/Macaulay2/m2/reals.m2
Outdated
@@ -106,10 +106,13 @@ promote(RawRingElement,RingElement) := (x,R) -> new R from x | |||
promote(Number,InexactNumber) := (x,RR) -> promote(x,default RR) | |||
promote(ZZ,RR') := | |||
promote(QQ,RR') := | |||
promote(RR',RR') := |
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.
A bit confused:
- I think there's a better way to have promote behave like identity if the input ring and new ring are identical.
- The commit that changes this file says
fix isPromotable ring family
This reverts commit 63d7fc7.
But that commit doesn't seem to have anything to do with this file.
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.
the revert part of the message is an accident. will fix.
the addition of promote(XX',YY')
is an unfortunate side-effect of the messy way that inexact fields are implemented in Macaulay2 (which one day I'd love to rewrite from scratch, because it's such a mess).
They're not actual functions though because they never actually get called, really one should make them dummy functions.
nottosamering := (X,Y) -> ( | ||
if X === Y then error("expected ",pluralsynonym X, " for compatible rings") | ||
else error("expected ",synonym X," and ",synonym Y," for compatible rings")) | ||
tosamering = (M,N) -> ( |
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 don't mind keeping the old names if you don't want to change names in a bunch of places, but I don't think we should actively rename something camel-cased to all lower case. Also, maybe move these functions to where isPromotable
is defined instead.
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.
will do. not the most urgent thing right now.
once again, this is a draft.
be69753
to
da0a5fe
Compare
3fa8cc0
to
ef2e0e1
Compare
621457c
to
d2ac437
Compare
clean up promote code:
try
in promotepromote
that used to be in another PR of mine moved here, resolves the last issue in Promotion issues #3184