[Scilab-Dev] Object Orientation

Amanda Osvaldo lambdasoftware at yahoo.es
Tue Feb 21 19:48:03 CET 2017


Hi Clément.
I'm happy to know the community appreciate the object oriented
approaching in SciLAB.

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 ?

-- Amanda Osvaldo
On Mon, 2017-02-20 at 10:36 +0100, Clément David wrote:
> Hi Amanda,
> 
> > 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 ?
> 
> Nothing :) ! From the user point of view, a function can be passed by
> value and called later.
> 
> > 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.
> 
> 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]: https://wiki.scilab.org/Emulate%20Object%20Oriented%20in%20Scila
> b
> 
> Thanks,
> 
> --
> Clément
> _______________________________________________
> dev mailing list
> dev at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20170221/4b343cbe/attachment.htm>


More information about the dev mailing list