Fixes problems people have been having with vector/matrix arguments
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10395 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5993327dc0
commit
41220df85b
1 changed files with 8 additions and 0 deletions
|
|
@ -1604,6 +1604,7 @@ void R::dispatchFunction(Node *n) {
|
||||||
int nfunc = Len(dispatch);
|
int nfunc = Len(dispatch);
|
||||||
Printv(f->code,
|
Printv(f->code,
|
||||||
"argtypes <- mapply(class, list(...))\n",
|
"argtypes <- mapply(class, list(...))\n",
|
||||||
|
"argv <- list(...)\n",
|
||||||
"argc <- length(argtypes)\n", NIL );
|
"argc <- length(argtypes)\n", NIL );
|
||||||
|
|
||||||
Printf(f->code, "# dispatch functions %d\n", nfunc);
|
Printf(f->code, "# dispatch functions %d\n", nfunc);
|
||||||
|
|
@ -1637,10 +1638,17 @@ void R::dispatchFunction(Node *n) {
|
||||||
if(tm) {
|
if(tm) {
|
||||||
replaceRClass(tm, Getattr(p, "type"));
|
replaceRClass(tm, Getattr(p, "type"));
|
||||||
}
|
}
|
||||||
|
if (DohStrcmp(tm,"numeric")==0) {
|
||||||
|
Printf(f->code, "%sis.numeric(argv[[%d]])",
|
||||||
|
j == 0 ? "" : " && ",
|
||||||
|
j+1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
Printf(f->code, "%sextends(argtypes[%d], '%s')",
|
Printf(f->code, "%sextends(argtypes[%d], '%s')",
|
||||||
j == 0 ? "" : " && ",
|
j == 0 ? "" : " && ",
|
||||||
j+1,
|
j+1,
|
||||||
tm);
|
tm);
|
||||||
|
}
|
||||||
p = Getattr(p, "tmap:in:next");
|
p = Getattr(p, "tmap:in:next");
|
||||||
}
|
}
|
||||||
Printf(f->code, ") { f <- %s%s }\n", sfname, overname);
|
Printf(f->code, ") { f <- %s%s }\n", sfname, overname);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue