title: How can classes be made parametric in Perl 6?
body: <p>Normally in Perl 6, only roles are allowed to be parametric. Here, we'll be attempting to make classes, a <a href="https://en.wikipedia.org/wiki/Kind_(type_theory)" rel="noreferrer">kind</a> (referred to from here on out as a metaobject) that isn't normally allowed to be parametric, parametric.</p>
  
  <p>If you try to make a class parametric the naive way, this happens:</p>
  
  <pre><code>bastille% perl6 -e 'class Foo[::T] {}'
  ===SORRY!=== Error while compiling -e
  Unable to parse class definition
  at -e:1
  ------&gt; class Foo⏏[::T] {}
      expecting any of:
          generic role
  </code></pre>
  
  <p>But if you take a look at what metaobject the <code>CArray</code> type from <code>NativeCall</code> uses, you'll find that it's in fact a class, not a role, yet it's still parametric!</p>
  
  <pre><code>bastille% perl6 -MNativeCall -e 'say CArray[int32].HOW.^name'
  Perl6::Metamodel::ClassHOW+{&lt;anon&gt;}+{&lt;anon&gt;}
  </code></pre>
  
  <p>How is this done?</p>