Parametric polymorphism: Difference between revisions

m
(Go solution)
m (→‎{{header|Go}}: grammar)
Line 253:
t1 and t2 have different static types, but when they are passed to average, they are bound to parameter c, of interface type, and their static types are not visible within average.
 
Implementation of binaryTree and bTree is dummied, but you can see that implementation of average of binaryTree contains code specific to it'sits representation (left, right) and that implementation of bTree contains code specific to it'sits representation (buckets.)
<lang go>package main
 
1,707

edits