<html><head></head><body><div>Hi Clément.</div><div><br></div><div style="margin-left: 3ch;"><div>I'm happy to know the community appreciate the object oriented approaching in SciLAB.</div><div><br></div><div>I want to start with a fake Object Orientation, however, how I can learn about the SciLAB's bytecodes to implement a true Object Orientation ?</div><div><br></div></div><div>-- Amanda Osvaldo</div><div><br></div><div>On Mon, 2017-02-20 at 10:36 +0100, Clément David wrote:</div><blockquote type="cite"><pre>Hi Amanda,

<blockquote type="cite">
I'm searching for inspiration in Struct DataType. I believe I can use it as a base.

So, I need to ask.

What prevents me to insert a function inside a struct ?
</blockquote>

Nothing :) ! From the user point of view, a function can be passed by value and called later.

<blockquote type="cite">
Because of what i understood, in the Scilab's  core the  struct datatype uses a class named
SingleStruct , which in turn,  uses the class InternalType to handle the struct's content.

And the class InternalType can handle functions.

If someone has a better idea I would like to listen.
</blockquote>

Some times ago, a detailed analysis has been done to implement (aka emulate as this is not native)
an object oriented paradigm. Like in Javascript or Python, the user should just follow some coding
conventions to define the object and pass it around. However I prefer using an mlist() rather than a
struct() to avoid multi-dimensional issues ; a struct() have multiple dimensions defined by :

a.b = 1;
a // 1x1 struct
a(4,5).b = 2; // resize a
a // 4x5 struct with empty "b" values

Do not hesitate to contribute and edit the wiki if you need / look for more tests !

[1]: <a href="https://wiki.scilab.org/Emulate%20Object%20Oriented%20in%20Scilab">https://wiki.scilab.org/Emulate%20Object%20Oriented%20in%20Scilab</a>

Thanks,

--
Clément
_______________________________________________
dev mailing list
<a href="mailto:dev@lists.scilab.org">dev@lists.scilab.org</a>
<a href="http://lists.scilab.org/mailman/listinfo/dev">http://lists.scilab.org/mailman/listinfo/dev</a>
</pre></blockquote></body></html>