Hello<br> <div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
For your problem you should have a look at the funcprot function.<br>
<br>
However, the default mode is to issue a warning when redefining predefined functions.<br></blockquote><div>Thanks for reply. <br></div><div><br>I tried following <br></div><div> A  =<br>
 <br>
    2.    3.    4.    78.  <br>   

<br>
 <br>
-->funcprot(2)<br>
 <br> 

<br>
-->sum(A)<br>
 ans  =<br>
 <br>
    87.  <br>
 <br>
-->sum=98<br>
      !--error 223 <br>
It is not possible to redefine the sum primitive this way (see clearfun).<br>
<br> <br>
-->deff('y=f(x)','y=x*x')<br>
 <br>
-->deff('y=f(x)','y=2*x*x')<br>
                         !--error 111 <br>
Trying to re-define function f.<br>
<br>
<br>
User defined function should be redefined. At the same time scilab predefined functions should not.<br>
I tried following:<br>
<br>
-->clearfun f<br>
 ans  =<br>
 <br>
  F  <br>
 <br>
-->clearfun sum<br>
 ans  =<br>
 <br>
  T  <br>Now it is allowing to redefine sum which should be 
protected. On the other hand it is not allowing to redefine the function f. Which one needs to  redefine several times in one session.<br><br>
<br>
What is going wrong? Am I missing something.<br>
Regards <br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><font color="#888888"></font><div><div></div><div class="h5"><br>
<br>
On 09/22/2011 12:51 PM, Manjusha Joshi wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
sum, prod etc. are predefined functions in scilab.<br>
<br>
if some one with out knowing the name of the  predefind function use  it as avariable name, as follows:<br>
<br>
<br>
-->A=[2,3,4,78]<br>
 A  =<br>
<br>
    2.    3.    4.    78.<br>
<br>
-->sum(A)<br>
 ans  =<br>
<br>
    87.<br>
<br>
-->sum=96<br>
 sum  =<br>
<br>
    96.<br>
<br>
-->sum(A)<br>
       !--error 21<br>
Invalid index.<br>
<br>
<br>
<br>
 scilab not even complains. In old versions at least there was some error message.<br>
<br>
This happens in the current session only.<br>
Is there any way to protect the predefined functions and their names?<br>
I think we should declare these function names as predefined functions.<br>
<br>
<br>
-- <br>
Manjusha S. Joshi<br>
<br>
blog:<a href="http://manjushajoshi.wordpress.com/" target="_blank">http://manjushajoshi.<u></u>wordpress.com/</a><br>
<br>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Manjusha S. Joshi  <br>Mobile:  09822 319328<br>blog:<a href="http://manjushajoshi.wordpress.com/">http://manjushajoshi.wordpress.com/</a><br><br> <br><br>