[Scilab-users] Extraction of unusual fields of custom mlist in Scilab 6
Pierre Vuillemin
contact at pierre-vuillemin.fr
Tue Mar 7 16:55:37 CET 2017
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
More information about the users
mailing list