Kotlin, project structure

1k views Asked by At

I am writing a kotlin port of glm and I'm gonna use it also for java projects.

In these java projects, I'd like to call, for example, glm.mul(...):

where mul() is a function of the mat2x2_operators interface

Now, if I have glm declared as an interface and its companion object extends mat2x2_operators in this way

interface glm {
   companion object :
       mat2x2_operators,

I have mul available on java via

glm.Companion.mul(...)

If I try to declare glm as an object:

glm.INSTANCE.mul(...)

the reason I don't write mul directly under glm is because I have hundred of functions that I'd like to keep ordered in different places (interfaces), such as mat2x2_operators precisely

Is there a way to accomplish that?

0

There are 0 answers