As a bit of background, I am using Scala's joda DateTime. It seems that everywhere Scala developer uses Joda DateTime, he defines some implicit datetimeOrderingwhich then import. Each library seems to define its own. Sometimes conflicts arise with the presence of several definitions from different libraries in the scope.
I am wondering if and how the Java library (in this case joda, but this is just an example) can define such implicit Java source code that it compiles the equivalent Scala bytecode so that it can be imported into the Scala program. I know that I can do things like implementation def +(x:Whatever):Whateverin Java using $plus(...), but I don't know how I would define implicit.
I'm not a joda developer, just wondering how this will work. Obviously, joda may include one Scala file in its project, but I'm curious if there are other options. Does the implicit requirement in Java define scala -tools.jar requirement on the classpath? Can implicit be defined directly in Java code? What does the implementation look like implicit?
Brian source
share