Thank you very much for you replies.

1. Yes, I wanted to avoid type switches (in different modules).
2. "myType" is a placeholder for more complex types, and the type "Compare" 
is only the the first in a row. The goal is some kind of a "contain" 
operation over lists of different objects (thats why an interface makes 
sense).
3. First i thought the "sort" package simply don't have the problem, but 
your view is much better - they avoided it.
4. Maybe a solution could be not to expect the definition of a operation 
(like "less"), but to expect a metric for such a operation (like some kind 
of a "order"). Then the operation can use a simple type. And I don't have 
to decide should I use the "type Compare interface" (has the needed method) 
or the type "interface{}" (exchangable value).

I hope my conclusion is a least slightly correct,
ty, C.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to