JIMS code

calixte calixte.denizet at ac-rennes.fr
Sun Mar 28 13:55:13 CEST 2010


Hello,


> > is converted into the mlist : obj = mlist(['_JObj' '_id' 'M' 'F'])
> >  * _id is the pos of the object in an array on the java side, for example _id=314
> >  * for the method, I create a scilab function in using deff : deff('y=tmpmacro(varargin)','y=wrapInMList(invoke(314,''M'',varargin))')
> >     invoke returns the id of the object returned by the invocation of the method M of the object 314. The function tmpmacro is     affected to the field 'M' of the mlist
> >  * for the field, I create a function using deff too, the syntax in Scilab is obj.F(32) affects 32 to F on the java side and obj.F() gets the value of F.
> I use the getfield to see what is the content of the keyword 'M' in
> mlist.  the result is: y=ans(varargin). what is that mean? why not
> "y=M(varargin)"?

You're right, it's probably a bug, but it isn't a problem...

> For example, when call "A.func(x, y)"( A is a mlist),I want to call the
> C function "sci_func(A.id, x, y)" , then how to wrap the func in the
> mlist?  if A=mlist(['name,id,func'],"example",1,?), what is the content
> of '?'  

A mlist is a typed list, if the type of your mlist is for example
PythObj, you should define it :

--> A=mlist(['PythObj' 'name' 'id' 'func'], 'example', 1, sci_func)

typeof(A) returns PythObj (take a look at the help page about
overloading...)
A.name returns example
A.id returns 1
A.func(x,y) returns sci_func(x,y)
 
Calixte




More information about the dev mailing list