Re: [Scilab-users] %mlistType_clear overloading of clear() for mlist custom types

2020-07-01 Thread Clément David
Hello all, Indeed this introduction was made to fulfill the needs for external objects to be clear as any other Scilab variables. I made some early prototypes for hdf5 and xml but failed to push them further. IMHO this is feasible but there are some specific needs for each overloading

Re: [Scilab-users] %mlistType_clear overloading of clear() for mlist custom types

2020-07-01 Thread Stéphane Mottelet
Le 01/07/2020 à 18:52, Samuel Gougeon a écrit : Le 01/07/2020 à 13:47, Stéphane Mottelet a écrit : Right, sorry for my previous message. But, at the user level there are very few use cases: the clear overload is only useful if some mlist fields contain some pointers to allocated data. For

Re: [Scilab-users] %mlistType_clear overloading of clear() for mlist custom types

2020-07-01 Thread Stéphane Mottelet
Le 01/07/2020 à 18:46, Samuel Gougeon a écrit : Le 01/07/2020 à 13:29, Lamy Alain a écrit : Hello Samuel, Comparing with the example in the « clear » page, the “%test_clear” function must have one argument : --> m = mlist("test"); --> function %test_clear(x) >   disp("mlist test

Re: [Scilab-users] %mlistType_clear overloading of clear() for mlist custom types

2020-07-01 Thread Samuel Gougeon
Le 01/07/2020 à 13:47, Stéphane Mottelet a écrit : Right, sorry for my previous message. But, at the user level there are very few use cases: the clear overload is only useful if some mlist fields contain some pointers to allocated data. For example sparse LU  factors or Java objects.

Re: [Scilab-users] %mlistType_clear overloading of clear() for mlist custom types

2020-07-01 Thread Samuel Gougeon
Le 01/07/2020 à 13:29, Lamy Alain a écrit : Hello Samuel, Comparing with the example in the « clear » page, the “%test_clear” function must have one argument : --> m = mlist("test"); --> function %test_clear(x) >   disp("mlist test cleared") > endfunction --> clear m; "mlist test

Re: [Scilab-users] %mlistType_clear overloading of clear() for mlist custom types

2020-07-01 Thread Stéphane Mottelet
Right, sorry for my previous message. But, at the user level there are very few use cases: the clear overload is only useful if some mlist fields contain some pointers to allocated data. For example sparse LU  factors or Java objects. S. Le 01/07/2020 à 13:29, Lamy Alain a écrit : Hello

Re: [Scilab-users] %mlistType_clear overloading of clear() for mlist custom types

2020-07-01 Thread Lamy Alain
Hello Samuel, Comparing with the example in the « clear » page, the “%test_clear” function must have one argument : --> m = mlist("test"); --> function %test_clear(x) > disp("mlist test cleared") > endfunction --> clear m; "mlist test cleared" Alain

Re: [Scilab-users] %mlistType_clear overloading of clear() for mlist custom types

2020-07-01 Thread Stéphane Mottelet
Hi, https://codereview.scilab.org/#/c/20679/ says: add a %foo_clear overloading on mlist This overload will be called at the end of the scope when a variable will not be accessible anymore for clearing allocated data. So it does not say that %foo_clear is called when using "clear". The

[Scilab-users] %mlistType_clear overloading of clear() for mlist custom types

2020-07-01 Thread Samuel Gougeon
Hello, Scilab 6.1.0 brings a feature about clearing mlists, that can now be overloaded. However, it's a special overloading feature, that does not replace the role of clear(), but that comes in addition to it, as documented in the clear page:

Re: [Scilab-users] Calling Function from Structure Field

2020-07-01 Thread Chin Luh Tan
Thanks Stephane and Samuel for the prompt reply, so I could move forward with the functional programming method instead of keep trying to emulate the OOP way.  Best Regards, Chin Luh___ users mailing list users@lists.scilab.org

Re: [Scilab-users] Calling Function from Structure Field

2020-07-01 Thread Samuel Gougeon
Hello Chin Luh, Yes, it's a very good question. As far as i know -- and i tried various things, as you did --, this is currently not possible. The missing feature is the "this" object, refering to the /parent/ structure of which the function is a field. This would be a very nice feature,

Re: [Scilab-users] Calling Function from Structure Field

2020-07-01 Thread Stéphane Mottelet
Hi, --> my_struct.func(my_struct) is the only way. This is not possible to it the way you would like, it would need real object-oriented features which Scilab does not have. At least, we could mimic this if field extraction could be overloaded. S. Le 01/07/2020 à 05:44, Chin Luh Tan a

Re: [Scilab-users] Difference in output from mtlb_dir function between 6.0.2 and 6.1.1

2020-07-01 Thread Samuel Gougeon
Hello Chris, Le 30/06/2020 à 13:03, Chris O'Shannassy a écrit : Hi; I just installed SciLab 6.1 on my Mac, and unfortunately I’ve tripped over running doing my first task.  I have a few small scripts which work fine under 6.0.2, using the mtlb_dir command to get a file list to process.  It