[Scilab-Dev] SEP: Object oriented programming under scilab

Collette Yann ycollet at freesurf.fr
Thu Oct 2 22:04:05 CEST 2008


I think a good source of inspiration for object oriented programming for 
scilab is python. No types like with scilab but a good hability for 
object oriented programming.

Sylvestre Ledru a écrit :
>> 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.
>   
This kind of programming is a little bit pythonic.
> In the meantime, the point "have the possibility to overload macros"
> should be a specific SEP which could be address in Scilab 6.
>
> Sylvestre
>
>   
Yann COLLETTE




More information about the dev mailing list