Hi everybody, i'm implementing object orientation in SciLAB, begin for
inheritance, encapsulation, and aggregation.

With a syntax like:

class GeometricHandle

public attribute = 5;

public function calc(x)
return x = x * attribute;
endfunction


endclass

instance = GeometricHandle();
instance.calc(10);

-->
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 ?

Like someting: 

instance = struct();

instance.attribute = 5;
instance.calc = function(x) return x = x * attribute; endfunction;

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.

-- Amanda Osvaldo
_______________________________________________
dev mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/dev

Reply via email to