attached to methods and functions
named <tt>getitem</tt> and <tt>setitem</tt>.
</p>

<p>
If you had a lot of different methods, you can avoid extra typing by using a macro.
For example:
</p>

<div class="code">
<pre>
%define RANGE_ERROR
{
  try {
    $action
  }
  catch (RangeError) {
    Tcl_SetResult(interp, (char *)"Array index out-of-bounds", TCL_STATIC);
    return TCL_ERROR;
  }
}
%enddef

%exception getitem RANGE_ERROR;
%exception setitem RANGE_ERROR;
</pre>
</div>

<p>
Since SWIG's exception handlin