Parametric polymorphism: Difference between revisions
Updated C3
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(Updated C3) |
||
Line 222:
=={{header|C3}}==
<syntaxhighlight lang="c3">module tree(<Type>);
struct Tree
Line 231:
}
fn void Tree.
{
if (
if (
}
</syntaxhighlight>
Usage:
▲<syntaxhighlight lang="c3">define IntTree = tree<int>::Tree;
fn void test()
{
inttree.
}</syntaxhighlight>
|