Generic Interfaces

Monkey Forums/Monkey Programming/Generic Interfaces

Nobuyuki(Posted 2013) [#1]
So I heard somewhere that around v70, interfaces can be generic now? Is this a documented feature? Is it fully supported and reliable? I want to update one of my projects to use this, but since it's a library, I don't want to do it if it's not an officially-supported feature of the language yet.


Nitty-gritty details for those of you who care: Specifically, I want to implement my version of Comparator<T> (from monkey-timsort) as an interface so that classes can specify themselves as a comparator when sent to a generic Sorter<T> (of which TimSort<T> will eventually become one of, once all of this is standardized). I still hope to standardize sorting into all of the default monkey containers in a generic way; generic interfaces could simplify the coding patterns to do this...


marksibly(Posted 2013) [#2]
It's WIP and not officially supported yet - I left it enabled by accident.


Goodlookinguy(Posted 2013) [#3]
You're not going to disable now are you? Cause I've been using it since I discovered it a couple of months ago.

It's been working very smoothly.


Nobuyuki(Posted 2013) [#4]
>It's WIP and not officially supported yet - I left it enabled by accident.

Thanks! I look forward to seeing what the tests bear out.


marksibly(Posted 2013) [#5]
> It's been working very smoothly.

Well, that's good to know!

There are a couple of 'edge' cases I know about that are yet to be handled, to do with interfaces inheriting other interfaces etc, but it should happen officially eventually.


Belimoth(Posted 2013) [#6]
Excellent!