Re: [Scilab-users] Extraction of unusual fields of custom mlist in Scilab 6

2017-03-10 Thread Clément David
Hi Pierre,

Nice catch, could you open a bug on that ?

The bug is also much more understandable with :

a = mlist(['mytype']);
b = mlist(['myothertype']);
function out = %mytype_e(varargin)
var   = varargin($);
field = varargin(1);
disp(typeof(varargin))
disp(typeof(var))
disp(typeof(field))
out = [];
endfunction
a(b);

Which display that var and field does not have the same type nor value when 
there is only 1 argument
:/ .

Thanks,

--
Clément
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Extraction of unusual fields of custom mlist in Scilab 6

2017-03-07 Thread Pierre Vuillemin

Hi all,

I am encountering some difficulties with overloading in Scilab 6, and 
I'm wondering if this is a bug or not.


Consider the following example,

a = mlist(['mytype']);
b = mlist(['myothertype']);
function out = %mytype_e(varargin)
   var   = varargin($);
   field = varargin(1);
   disp(typeof(field))
   out = [];
endfunction
a(b);

It defines two objects 'a' and 'b' of types 'mytype' and 'myothertype'. 
The extraction is overloaded for 'mytype' and displays the type of the 
field that is meant to be extracted.

At the end, I try to extract 'b' from 'a'.

In Scilab 5.5, 'b' is actually passed to the overloading function and 
'myothertype' is displayed by 'a(b)'.
Scilab 6 behaves differently and 'field' in the overloading function is 
a string equal to 'myothertype'.



Best regards,

Pierre
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users