Not sure about the $symname substitution, but I think there's a much more straightforward way to fix your problem: declare two more specific typemaps:

%typemap(in) int *singles_array {
  ...
}

%typemap(in) int *doubles_array {
  ...
}

SWIG will apply these typemaps according to the parameter name in the declaration.

Stefan

On Sun, Jul 24, 2011 at 5:07 PM, Bob Hood <bhood2@comcast.net> wrote:
On 7/24/2011 1:34 PM, Bob Hood wrote:
I just discovered the $symname special typemap variable, and it looks like that would provide the conversion context I'm after, but it doesn't appear to work for Director typemaps, just standard typemaps.  When I use it in a standard typemap, it substitutes properly in the generated wrapper code.  However, if I use it in a Director typemap (e.g., "directorin"), SWIG passes it through to the wrapper code verbatim ("$symname").

Is this another 2.0.4 bug?

Actually, looks like an omission.  I looked at the code, and there's no actual substitution taking place with Director methods.  Seems easy enough to patch it to make it work.  I put in this code:

    [...]
    /* wrap complex arguments to PyObjects */
    String *symname = NewStringf("%s_%s", classname, pyname);
    Replaceall(wrap_args, "$symname", symname);
    Delete(symname);
    Printv(w->code, wrap_args, NIL);
    [...]

and my Director typemap now substitutes "$symname" with a "<class>_<method>" string using this.  Is there some reason why it has never been added to the python.cxx module?

------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Swig-user mailing list
Swig-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user