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 http://lists.scilab.or

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, enabli

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 écrit

[Scilab-users] Calling Function from Structure Field

2020-06-30 Thread Chin Luh Tan
Hi,   I am wondering if this is possible:  I've a structure with data and function pointer, for example: mystruct.data = 5; mystruct.func =%myfun calling mystruct.func() will call myfun with the input of mystruct.data.  To put it in example, this is what I tried: //  define an in