Extern Interfaces?

Monkey Forums/Monkey Programming/Extern Interfaces?

AdamRedwoods(Posted 2013) [#1]
Extending monkey for external libraries that require function pointers, I find that externed interfaces could be a potential solution, rather than trying to implement an entirely new target (as I have now in wxMonkey). Anyone know of a reason it shouldn't/can't be implemented?

Using an externed class eventually runs into the problem of single inheritance.


marksibly(Posted 2013) [#2]
I did have a look at this, but the major problem is 'symbol munging clashes', eg:

Extern

Interface I
  Method Blah:Void()   'munged symbol is 'Blah'
End

Public

Class C
  Method Blah:Void()   'munged symbol is generated by translator
End

Class D Extends C Implements I
  Method Blah:Void()   'munged symbol clash!
End


There are worse cases too, and while there are ways around these problems, they're messy (even just detecting the problem) and I didn't pursue it further. I may yet one day, but not in the near future.


AdamRedwoods(Posted 2013) [#3]
Ok, thanks for the info.