<html><head></head><body><div>Hi everybody, i'm implementing <b>object orientation</b> in SciLAB, begin for inheritance, encapsulation, and aggregation.</div><div><br></div><div>With a syntax like:</div><div><br></div><div>class GeometricHandle</div><div><br></div><div style="margin-left: 3ch;"><div>public attribute = 5;</div></div><div><br></div><div style="margin-left: 3ch;"><div>public function calc(x)</div><div style="margin-left: 3ch;"><div>return x = x * attribute;</div></div><div>endfunction</div><div><br></div></div><div>endclass</div><div><br></div><div>instance = GeometricHandle();</div><div>instance.calc(10);</div><div><br></div><div>--></div><div><br></div><div>I'm searching for inspiration in Struct DataType. I believe I can use it as a base.</div><div><br></div><div>So, I need to ask.</div><div><br></div><div style="margin-left: 3ch;"><div style="margin-left: 3ch;"><div><b>What prevents me to insert a function inside a struct ?</b></div></div></div><div><br></div><div>Like someting: </div><div><br></div><div>instance = struct();</div><div><br></div><div>instance.attribute = 5;</div><div>instance.calc = function(x) return x = x * attribute; endfunction;</div><div><br></div><div>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.</div><div><br></div><div>And the class InternalType can handle functions.</div><div><br></div><b>If someone has a better idea I would like to listen.</b><div><b><br></b></div><div>-- Amanda Osvaldo</div></body></html>