[Scilab-Dev] SEP: Object oriented programming under scilab
Sylvestre Ledru
sylvestre.ledru at inria.fr
Thu Oct 2 15:34:19 CEST 2008
> You will find in this SEP some thoughts related to object oriented
> programming under scilab: what do we need to be able to start building
> objects under Scilab.
> This is a first version. I am waiting for a lot of comments ...
Here is mine (and we had some chat about it internaly).
First, I am convienced that Scilab should offer some object oriented
feature.
A more overall view, IMHO, this SEP is caught between two stools ("le
cul entre deux chaises" dans notre langue).
You are taking the current Scilab language with the limitations and you
are proposing to extend the "mlist trick".
I think we must go futher in the proposal. We should not stick on the
mlist way and provide a dedicated way of doing it.
A example could be:
class myClassA:
// maybe we declare the local variable
function setAB(variable)
__variable=variable
endfunction
function res = getAB()
res = __variable
endfunction
function res = compute(variable2)
res = variable2 + __variable
endfunction
endclass
// extend the class myClassA
class myNewObject(myClassA):
function res = greatCompute(variable)
res = variable * %pi + __variable
endfunction
endclass
It is just a quick idea and proposal.
In the meantime, the point "have the possibility to overload macros"
should be a specific SEP which could be address in Scilab 6.
Sylvestre
More information about the dev
mailing list