-
Notifications
You must be signed in to change notification settings - Fork 28
Comparable #506
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
Comparable #506
Conversation
|
||
val nativeCtors: Map[FQName, SDKConstructor] = Map( | ||
FQName.fromString("Morphir.SDK:Maybe:just") -> just, | ||
FQName.fromString("Morphir.SDK:Maybe:nothing") -> nothing, | ||
FQName.fromString("Morphir.SDK:Result:ok") -> ok, | ||
FQName.fromString("Morphir.SDK:Result:err") -> err | ||
FQName.fromString("Morphir.SDK:Result:err") -> err, | ||
FQName.fromString("Morphir.SDK:Basics:GT") -> gt, |
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.
Just FYI, I added support to be able to put these in the "new" sdk/*SDK.scala definitions, if you prefer to have them there. I think it's straightforward, but happy to walk through if no.
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.
Thanks, switched mine over to follow that pattern
morphir/runtime/src/org/finos/morphir/runtime/quick/EvaluatorQuick.scala
Outdated
Show resolved
Hide resolved
morphir/runtime/test/jvm/src/org/finos/morphir/runtime/EvaluatorMDMTests.scala
Show resolved
Hide resolved
morphir/src/org/finos/morphir/ir/conversion/ToMorphirType.scala
Outdated
Show resolved
Hide resolved
morphir/src/org/finos/morphir/ir/conversion/ToMorphirValue.scala
Outdated
Show resolved
Hide resolved
5c704e1
to
c0a934c
Compare
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.
lgtm, thanks for the changes
@DamianReeves I'm happy with this, please review when you're able. |
53f398f
to
6da0e32
Compare
|
||
case (Concept.Order, RTValue.ConstructorResult(FQString("Morphir.SDK:Basics:gT"), List())) => | ||
Data.Order(1) | ||
case (Concept.Order, RTValue.ConstructorResult(FQString("Morphir.SDK:Basics:lT"), List())) => |
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.
Why lT
and not LT
Data.Order(1) | ||
case (Concept.Order, RTValue.ConstructorResult(FQString("Morphir.SDK:Basics:lT"), List())) => | ||
Data.Order(-1) | ||
case (Concept.Order, RTValue.ConstructorResult(FQString("Morphir.SDK:Basics:eQ"), List())) => |
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.
Why eQ
and not EQ
?
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.
This is using a FQString, which is an extractor intended for easy matching, given that FQName(someString) doesn't work in match statements. FQString uses toString (and then falls back to matching on that string); given that the default is camelCase for the localName, EQ becomes eQ.
Potentially that extractor could be broken up for different formats, but that seemed like a lot of additional complexity for minor gain.
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.
Well that FQString extractor is wrong and not following Morphir name handling conventions. That is going to add un-needed confusion.
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 only feel comfortable merging this PR if there is a fast follower to correct FQString
. The Morphir naming conventions are unique enough, adding an arbitrary divergence will only complicate things now and in the future.
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 think it's correct when used for functions, but not for constructors/types - looking over use cases, tho, it is mostly (only?) being used for constructors/types. That will only take a moment to change.
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 fixed it, fast enough follow? :)
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.
LGTM
Implemented Comparable and basics SDK functions that use it