o * {
  if (!SWIG_IsOK(SWIG_ConvertPtr($input, (void **) &amp;$1, $descriptor(Foo *), 0))) {
    SWIG_exception_fail(SWIG_TypeError, "in method '$symname', expecting type Foo");
  }
}
</pre>
</div>

<H2><a name="Tcl_nn43">37.8 Turning a SWIG module into a Tcl Package.</a></H2>


<p>
SWIG generates all of the code necessary to create a Tcl extension package.
To set the package version use the <tt>-pkgversion</tt> option. For example:
</p>

<div class="code">
<pre>
% swig -tcl -pkgversion 2.3 example.i
</pre>