class Notes
# ...dynamic and static versions of add...
def add<of T>(a as T,b as T) as T
return a + b
I'm not listing the benefits / drawbacks of this approach because I don't know enough about how generics are implemented in the CLR. My guess would be:
(*) benefits: great flexibility, fast at runtime
(*) drawbacks: code bloat??? slower compilation???
In any case my point is that it might be interesting to extend this How-To page so that it discusses the generics approach as well.
BTW I don't know if Cobra supports generic methods at this stage, but I'm sure it will support them in the future as they are part of C#.