* Bug 15309: eval() set obsolete as a duplicate of evstr() 15/19515/6
Samuel GOUGEON [Wed, 25 Oct 2017 23:36:55 +0000 (01:36 +0200)]
  http://bugzilla.scilab.org/15309

  * Searched: [^_]eval[^a-zA-Z0-9_] in all files
  * Occurences in Matlab .m  files ignored (Matlab eval())
  *            in m2sci/eval.xml & sci_eval.sci ignored (Matlab eval())
  * Occurences in Maple .map files ignored (Maple eval())
  * Occurences in margins.tst + .dia.ref are Maple ones: ignored

Change-Id: Iae85dd2e1492e37d0cc73351a1b8d9b0ed19f304

33 files changed:
scilab/CHANGES.md
scilab/modules/core/tests/unit_tests/newfun.dia.ref [deleted file]
scilab/modules/core/tests/unit_tests/newfun.tst
scilab/modules/development_tools/macros/bench_run.sci
scilab/modules/fileio/tests/unit_tests/mfscanf.dia.ref
scilab/modules/fileio/tests/unit_tests/mfscanf.tst
scilab/modules/fileio/tests/unit_tests/msscanf.dia.ref
scilab/modules/fileio/tests/unit_tests/msscanf.tst
scilab/modules/genetic_algorithms/demos/GAdemo.sce
scilab/modules/genetic_algorithms/demos/MOGAdemo.sce
scilab/modules/genetic_algorithms/demos/NSGA2demo.sce
scilab/modules/genetic_algorithms/demos/NSGAdemo.sce
scilab/modules/gui/macros/tree/uiInsertNode.sci
scilab/modules/scicos/macros/scicos_scicos/%Block_p.sci
scilab/modules/scicos/macros/scicos_scicos/%Link_p.sci
scilab/modules/scicos/macros/scicos_scicos/%graphics_p.sci
scilab/modules/scicos/macros/scicos_scicos/%model_p.sci
scilab/modules/scicos/macros/scicos_scicos/c_pass1.sci
scilab/modules/scicos/macros/scicos_scicos/scicos_flat.sci
scilab/modules/scicos_blocks/macros/Electrical/OpAmp.sci
scilab/modules/scicos_blocks/macros/Electrical/Switch.sci
scilab/modules/simulated_annealing/demos/SAdemo.sce
scilab/modules/string/help/en_US/eval.xml
scilab/modules/string/help/fr_FR/eval.xml
scilab/modules/string/help/ja_JP/eval.xml
scilab/modules/string/help/pt_BR/eval.xml
scilab/modules/string/help/ru_RU/eval.xml
scilab/modules/string/macros/eval.sci
scilab/modules/string/tests/benchmarks/bench_eval.tst [deleted file]
scilab/modules/string/tests/nonreg_tests/bug_7282.dia.ref [deleted file]
scilab/modules/string/tests/nonreg_tests/bug_7282.tst
scilab/modules/xcos/help/en_US/batch_functions/xcos_simulate.xml
scilab/modules/xcos/help/ja_JP/batch_functions/xcos_simulate.xml

index 6ac4668..da16947 100644 (file)
@@ -335,6 +335,7 @@ Obsolete functions or features
 * `nanmax` is obsolete and will be removed in Scilab 6.1. Please use `max` instead.
 * `xgetech` is obsolete and will be removed in Scilab 6.1. Please use `gca` instead.
 * `lstsize` is obsolete and will be removed in Scilab 6.1. Please use `size` instead.
+* `eval` is obsolete and will be removed in Scilab 6.1. Please use `evstr` instead.
 * `dgettext` is obsolete and will be removed in Scilab 6.1. Please use `gettext(domain, text)` instead.
 
 
diff --git a/scilab/modules/core/tests/unit_tests/newfun.dia.ref b/scilab/modules/core/tests/unit_tests/newfun.dia.ref
deleted file mode 100644 (file)
index 34157b6..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//<-- CLI SHELL MODE -->
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA
-// Copyright (C) 2009 - DIGITEO - Allan CORNET
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-fptr_cos = funptr("cos");
-newfun("cosAlias",fptr_cos);
-assert_checkequal(cos(2*%pi), cosAlias(2*%pi));
-assert_checktrue(clearfun("cosAlias"));
-if execstr("cosAlias(2*%pi)","errcatch") ==  0  then bugmes();quit;end
-errmsg =  msprintf(gettext("%s: Wrong value for input argument #%d: Valid function name expected.\n"), "newfun", 1);
-assert_checkerror('newfun(''1_function_name'',fptr_cos)', errmsg);
-errmsg =  msprintf(gettext("%s: Wrong size for input argument #%d: string expected.\n"), "newfun", 2);
-assert_checkerror('newfun(''new_function_name'',[fptr_cos,fptr_cos])', errmsg);
-errmsg =  msprintf(gettext("%s: Wrong size for input argument #%d: string expected.\n"), "newfun", 1);
-assert_checkerror('newfun([''new_function_name'',''new_function_name''],[fptr_cos,fptr_cos])', errmsg);
-errmsg =  msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"), "newfun", 1);
-assert_checkerror('newfun(1,[fptr_cos,fptr_cos])', errmsg);
-function test_1(x)
-    newfun(x, "cos");
-    assert_checkequal(eval(x + "(1)"), cos(1));
-endfunction
-test_1("cosAlias");
-assert_checkequal(cosAlias(1), cos(1));
-assert_checktrue(clearfun("cosAlias"));
-function test_2(x)
-    test_1(x);
-    assert_checkequal(eval(x + "(1)"), cos(1));
-endfunction
-test_2("cosAlias");
-assert_checkequal(cosAlias(1), cos(1));
-assert_checktrue(clearfun("cosAlias"));
-function test_3(x)
-    test_2(x);
-    assert_checkequal(eval(x + "(1)"), cos(1));
-endfunction
-test_3("cosAlias");
-assert_checkequal(cosAlias(1), cos(1));
-assert_checktrue(clearfun("cosAlias"));
-myvar = 3;
-newfun("myvar", fptr_cos);
-assert_checkequal(myvar, 3);
-clear myvar
-assert_checkequal(myvar(0), cos(0));
index f90d52d..5b57bef 100644 (file)
@@ -1,4 +1,5 @@
 //<-- CLI SHELL MODE -->
+//<-- NO CHECK REF -->
 // =============================================================================
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) ????-2008 - INRIA
@@ -27,7 +28,7 @@ assert_checkerror('newfun(1,[fptr_cos,fptr_cos])', errmsg);
 
 function test_1(x)
     newfun(x, "cos");
-    assert_checkequal(eval(x + "(1)"), cos(1));
+    assert_checkequal(evstr(x + "(1)"), cos(1));
 endfunction
 
 test_1("cosAlias");
@@ -36,7 +37,7 @@ assert_checktrue(clearfun("cosAlias"));
 
 function test_2(x)
     test_1(x);
-    assert_checkequal(eval(x + "(1)"), cos(1));
+    assert_checkequal(evstr(x + "(1)"), cos(1));
 endfunction
 
 test_2("cosAlias");
@@ -45,7 +46,7 @@ assert_checktrue(clearfun("cosAlias"));
 
 function test_3(x)
     test_2(x);
-    assert_checkequal(eval(x + "(1)"), cos(1));
+    assert_checkequal(evstr(x + "(1)"), cos(1));
 endfunction
 
 test_3("cosAlias");
index f1196ac..81260bc 100644 (file)
@@ -245,7 +245,7 @@ function [modutests_names, elapsed_time, nb_iterations] = bench_run(varargin)
     end
 
     modutests_names = test_list;
-    nb_iterations = eval(nb_iterations);
+    nb_iterations = evstr(nb_iterations);
 
     // XML management
     // ==============
index 5b40135..8807c9b 100644 (file)
@@ -216,7 +216,7 @@ Fs='%s';Fs=strcat(Fs(ones(1,2)),' ');
 Fd='%d';Fd=strcat(Fd(ones(1,n-2)),' ');
 fd=mopen(tmpf,'r');[n,a,b,c,d,e]=mfscanf(-1,fd,Fs+' '+Fd);mclose(fd);
 if n<>5 then bugmes();quit;end
-if norm([eval(a),eval(b),c,d,e]-A) > %eps then bugmes();quit;end
+if norm([evstr(a),evstr(b),c,d,e]-A) > %eps then bugmes();quit;end
 // same example but returned values are compacted in L
 fd=mopen(tmpf,'r');L=mfscanf(-1,fd,Fs+' '+Fd);mclose(fd);
 if length(L)<>3 then bugmes();quit;end
index 7ae68b3..31942bc 100644 (file)
@@ -243,7 +243,7 @@ Fs='%s';Fs=strcat(Fs(ones(1,2)),' ');
 Fd='%d';Fd=strcat(Fd(ones(1,n-2)),' ');
 fd=mopen(tmpf,'r');[n,a,b,c,d,e]=mfscanf(-1,fd,Fs+' '+Fd);mclose(fd);
 if n<>5 then pause, end
-if norm([eval(a),eval(b),c,d,e]-A) > %eps then pause, end
+if norm([evstr(a), evstr(b),c,d,e]-A) > %eps then pause, end
 
 // same example but returned values are compacted in L
 fd=mopen(tmpf,'r');L=mfscanf(-1,fd,Fs+' '+Fd);mclose(fd);
index 5c99716..d422ae3 100644 (file)
@@ -206,7 +206,7 @@ Fs='%s';Fs=strcat(Fs(ones(1,2)),' ');
 Fd='%d';Fd=strcat(Fd(ones(1,n-2)),' ');
 [n,a,b,c,d,e]=msscanf(-1,A1,Fs+' '+Fd);
 if n<>5 then bugmes();quit;end
-if norm([eval(a),eval(b),c,d,e]-A) > %eps then bugmes();quit;end
+if norm([evstr(a),evstr(b),c,d,e]-A) > %eps then bugmes();quit;end
 // same example but returned values are compacted in L
 L=msscanf(-1,A1,Fs+' '+Fd);
 if length(L)<>3 then bugmes();quit;end
index 6121714..a6e583b 100644 (file)
@@ -231,7 +231,7 @@ Fs='%s';Fs=strcat(Fs(ones(1,2)),' ');
 Fd='%d';Fd=strcat(Fd(ones(1,n-2)),' ');
 [n,a,b,c,d,e]=msscanf(-1,A1,Fs+' '+Fd);
 if n<>5 then pause;end 
-if norm([eval(a),eval(b),c,d,e]-A) > %eps then pause;end 
+if norm([evstr(a),evstr(b),c,d,e]-A) > %eps then pause;end 
 
 // same example but returned values are compacted in L
 L=msscanf(-1,A1,Fs+' '+Fd);
index be19aae..1c73b47 100755 (executable)
@@ -45,8 +45,8 @@ function demo_genetic_algo()
 
     ga_params = init_param();
     // Parameters to adapt to the shape of the optimization problem
-    ga_params = add_param(ga_params, "minbound", eval("min_bd_" + func + "()"));
-    ga_params = add_param(ga_params, "maxbound", eval("max_bd_" + func + "()"));
+    ga_params = add_param(ga_params, "minbound", evstr("min_bd_" + func + "()"));
+    ga_params = add_param(ga_params, "maxbound", evstr("max_bd_" + func + "()"));
     ga_params = add_param(ga_params, "dimension", 2);
     ga_params = add_param(ga_params, "beta", 0);
     ga_params = add_param(ga_params, "delta", 0.1);
index a58e8e6..a4fe73c 100755 (executable)
@@ -57,8 +57,8 @@ function demo_MOGA()
 
     ga_params = init_param();
     // Parameters to adapt to the shape of the optimization problem
-    ga_params = add_param(ga_params, "minbound", eval("min_bd_" + funcname + "(2)"));
-    ga_params = add_param(ga_params, "maxbound", eval("max_bd_" + funcname + "(2)"));
+    ga_params = add_param(ga_params, "minbound", evstr("min_bd_" + funcname + "(2)"));
+    ga_params = add_param(ga_params, "maxbound", evstr("max_bd_" + funcname + "(2)"));
     ga_params = add_param(ga_params, "dimension", 2);
     ga_params = add_param(ga_params, "beta", 0);
     ga_params = add_param(ga_params, "delta", 0.1);
@@ -98,7 +98,7 @@ function demo_MOGA()
         if isdef("get_opti_" + funcname) then
             t = 0 : 0.01 : 1;
             for i = 1 : length(t)
-                y_t(i,:) = eval("get_opti_" + funcname + "(t(" + string(i) + "))");
+                y_t(i,:) = evstr("get_opti_" + funcname + "(t(" + string(i) + "))");
             end
             plot(y_t(:,1), y_t(:,2), "k-");
         end
@@ -115,7 +115,7 @@ function demo_MOGA()
         if isdef("get_opti_"+funcname) then
             t = 0:0.01:1;
             for i=1:size(t,"*")
-                y_t(i,:) = eval("get_opti_" + funcname + "(t(" + string(i) + "))");
+                y_t(i,:) = evstr("get_opti_" + funcname + "(t(" + string(i) + "))");
             end
             plot(y_t(:,1), y_t(:,2), "k-");
         end
index 3cebdc7..de8b933 100755 (executable)
@@ -59,8 +59,8 @@ function demo_NSGA2()
 
     ga_params = init_param();
     // Parameters to adapt to the shape of the optimization problem
-    ga_params = add_param(ga_params, "minbound", eval("min_bd_"+funcname+"(2)"));
-    ga_params = add_param(ga_params, "maxbound", eval("max_bd_"+funcname+"(2)"));
+    ga_params = add_param(ga_params, "minbound", evstr("min_bd_"+funcname+"(2)"));
+    ga_params = add_param(ga_params, "maxbound", evstr("max_bd_"+funcname+"(2)"));
     ga_params = add_param(ga_params, "dimension", 2);
     ga_params = add_param(ga_params, "beta", 0);
     ga_params = add_param(ga_params, "delta", 0.1);
@@ -98,7 +98,7 @@ function demo_NSGA2()
         if isdef("get_opti_" + funcname) then
             t = 0:0.01:1;
             for i = 1:length(t)
-                y_t(i,:) = eval("get_opti_" + funcname + "(t(" + string(i) + "))");
+                y_t(i,:) = evstr("get_opti_" + funcname + "(t(" + string(i) + "))");
             end
             plot(y_t(:,1), y_t(:,2), "k-");
         end
@@ -115,7 +115,7 @@ function demo_NSGA2()
         if isdef("get_opti_" + funcname) then
             t = 0:0.01:1;
             for i=1:length(t)
-                y_t(i,:) = eval("get_opti_" + funcname + "(t(" + string(i) + "))");
+                y_t(i,:) = evstr("get_opti_" + funcname + "(t(" + string(i) + "))");
             end
             plot(y_t(:,1), y_t(:,2), "k-");
         end
index 443261a..c0cc4b3 100755 (executable)
@@ -58,8 +58,8 @@ function demo_NSGA()
 
     ga_params = init_param();
     // Parameters to adapt to the shape of the optimization problem
-    ga_params = add_param(ga_params, "minbound", eval("min_bd_" + funcname + "(2)"));
-    ga_params = add_param(ga_params, "maxbound", eval("max_bd_" + funcname + "(2)"));
+    ga_params = add_param(ga_params, "minbound", evstr("min_bd_" + funcname + "(2)"));
+    ga_params = add_param(ga_params, "maxbound", evstr("max_bd_" + funcname + "(2)"));
     ga_params = add_param(ga_params, "dimension", 2);
     ga_params = add_param(ga_params, "beta", 0);
     ga_params = add_param(ga_params, "delta", 0.1);
@@ -100,7 +100,7 @@ function demo_NSGA()
         if isdef("get_opti_"+funcname) then
             t = 0:0.01:1;
             for i=1:length(t)
-                y_t(i,:) = eval("get_opti_" + funcname + "(t(" + string(i) + "))");
+                y_t(i,:) = evstr("get_opti_" + funcname + "(t(" + string(i) + "))");
             end
             plot(y_t(:,1), y_t(:,2), "k-");
         end
@@ -117,7 +117,7 @@ function demo_NSGA()
         if isdef("get_opti_"+funcname) then
             t = 0 : 0.01 : 1;
             for i = 1 : size(t,"*")
-                y_t(i,:) = eval("get_opti_" + funcname + "(t(" + string(i) + "))");
+                y_t(i,:) = evstr("get_opti_" + funcname + "(t(" + string(i) + "))");
             end
             plot(y_t(:,1), y_t(:,2), "k-");
         end
index ac8f66c..dba08bb 100644 (file)
@@ -72,15 +72,15 @@ function myNewTree = uiInsertNode(tree, position, node)
 
         // if we have an integer position (ex: 1, 2, 3 ...)
         if nbElement == 1 & myPosition <> "1" then
-            pos = eval(TOKENS(1));
+            pos = evstr(TOKENS(1));
             prevPos = string(pos-1);
         end
 
         // if we have a complexe position (ex: 1.1, 2.4, 3.8 ...)
         if nbElement > 1 then
 
-            first = eval(TOKENS(nbElement-1));
-            second = eval(TOKENS(nbElement));
+            first = evstr(TOKENS(nbElement-1));
+            second = evstr(TOKENS(nbElement));
 
             if (second == 1) then
                 prevPos = TOKENS(1);
@@ -94,7 +94,7 @@ function myNewTree = uiInsertNode(tree, position, node)
                     prevPos = prevPos + "." + TOKENS(index);
                 end
 
-                pos = eval(TOKENS(nbElement));
+                pos = evstr(TOKENS(nbElement));
                 prevPos = prevPos + "." + string(pos-1);
             end
         end
index ff52f86..e9c813a 100644 (file)
@@ -39,7 +39,7 @@ function txt=graphics2txt(graphics)
     txt=[]
     for k=2:size(fn,"*")
         txt=[txt
-        sci2exp(eval("graphics."+fn(k)),fn(k))]
+        sci2exp(evstr("graphics."+fn(k)),fn(k))]
     end
 endfunction
 
@@ -58,7 +58,7 @@ function txt=model2txt(model)
             txt=[txt;fn(k)+" : SuperBlock"];
         else
             txt=[txt
-            sci2exp(eval("model."+fn(k)),fn(k))];
+            sci2exp(evstr("model."+fn(k)),fn(k))];
         end
     end
 endfunction
index 8c0643b..e37d342 100644 (file)
@@ -26,7 +26,7 @@ function %Link_p(l)
     fn = getfield(1, l);
 
     for i=2:size(fn,"*")
-        field = string(eval("l."+fn(i)));
+        field = string(evstr("l."+fn(i)));
 
         fieldSize = size(field, "*");
         if fieldSize == 0 then
index 1f0f1fc..f5f3d72 100644 (file)
@@ -23,6 +23,6 @@ function %graphics_p(graphics)
     fn = getfield(1, graphics);
 
     for k=2:size(fn,"*")
-        mprintf("%s\n", sci2exp(eval("graphics."+fn(k)), fn(k)))
+        mprintf("%s\n", sci2exp(evstr("graphics."+fn(k)), fn(k)))
     end
 endfunction
index 00d9570..f32f818 100644 (file)
@@ -61,7 +61,7 @@ function %model_p(model)
         end
     end
     for k=3:size(fn,"*")
-        mprintf("%s\n", sci2exp(eval("model."+fn(k)),fn(k)))
+        mprintf("%s\n", sci2exp(evstr("model."+fn(k)),fn(k)))
     end
 endfunction
 
index 92d9838..8b24a6f 100644 (file)
@@ -292,9 +292,9 @@ function  [blklst,cmat,ccmat,cor,corinv,ok,scs_m,flgcdgen,freof]=c_pass1(scs_m,f
 
         for i=1:size(sco_mat,1)
 
-            if eval(sco_mat(i,1))<MaxBlock then
+            if evstr(sco_mat(i,1))<MaxBlock then
 
-                sco_mat(i,1)=string(ind(eval(sco_mat(i,1))))
+                sco_mat(i,1)=string(ind(evstr(sco_mat(i,1))))
 
             end
 
@@ -351,7 +351,7 @@ function  [blklst,cmat,ccmat,cor,corinv,ok,scs_m,flgcdgen,freof]=c_pass1(scs_m,f
     tblock=find((sco_mat(:,2)=="-1")&(sco_mat(:,5)=="10"))
     ind=sco_mat(tblock,1);
     if ind<>[] then
-        ind=eval(ind(:))
+        ind = evstr(ind(:))
         //ind=find(tblock)
         //ind=ind(:)
         for k=ind'
index a54acf3..a1f2c77 100644 (file)
@@ -306,10 +306,10 @@ function  [cor,corinv,links_table,cur_fictitious,sco_mat,ok, IN, OUT, EIN, EOUT]
 
                 //shifting the scop_mat for regular blocks. Fady 08/11/2007
                 if scop_mat<>[] then
-                    v_mat=find(eval(scop_mat(:,1))<MaxBlock)
+                    v_mat=find(evstr(scop_mat(:,1))<MaxBlock)
                     v_mat=v_mat(:)
                     for j=v_mat
-                        scop_mat(j,1)=string(eval(scop_mat(j,1))+nb)
+                        scop_mat(j,1)=string(evstr(scop_mat(j,1))+nb)
                     end
                 end
                 //Adding the scop_mat to the old sco_mat.
index 5f23166..3252fa0 100644 (file)
@@ -47,7 +47,7 @@ function [x,y,typ]=OpAmp(job,arg1,arg2)
         //  SatH=10;
         // SatL=-10;
         // S=['OLGain';'SatH';'SatL'];
-        // Z=eval(S);
+        // Z = evstr(S);
         S=[];
         Z=[];
         model=scicos_model();
index eb248f3..5d679f3 100644 (file)
@@ -50,7 +50,7 @@ function [x,y,typ]=Switch(job,arg1,arg2)
         Ron=0.01;
         Roff=1e5;
         S=["Ron";"Roff"];
-        Z=eval(S);
+        Z = evstr(S);
         model.sim="Switch"
         model.blocktype="c"
         model.dep_ut=[%t %f]
index 2012e14..7adc037 100755 (executable)
@@ -46,8 +46,8 @@ function demo_sa_1()
 
     //////////////////////////////////////////
 
-    Min = eval("min_bd_"+func+"()");
-    Max = eval("max_bd_"+func+"()");
+    Min = evstr("min_bd_"+func+"()");
+    Max = evstr("max_bd_"+func+"()");
     x0  = (Max - Min).*rand(size(Min,1),size(Min,2)) + Min;
 
     deff("y=f(x)","y="+func+"(x)");
index 3178a95..bc82657 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="eval" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="eval" xml:lang="en">
     <refnamediv>
         <refname>eval</refname>
-        <refpurpose>evaluation of a matrix of strings</refpurpose>
+        <refpurpose>
+          evaluation of a matrix of strings  <emphasis role="bold">(obsolete)</emphasis>
+      </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
@@ -60,4 +65,16 @@ eval(Z)  //returns the matrix [1, 0.909];
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0.1</revnumber>
+                <revdescription>
+                  <literal>eval()</literal> is declared obsolete, to be removed from Scilab 6.1.0.
+                  Please use <literal>evstr()</literal> instead.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index b86f602..53e0f96 100644 (file)
@@ -1,8 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="eval" xml:lang="fr">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="eval" xml:lang="fr">
     <refnamediv>
         <refname>eval</refname>
-        <refpurpose>évaluation d'une matrice de chaînes de caractères</refpurpose>
+        <refpurpose>
+          évaluation d'une matrice de chaînes de caractères  <emphasis role="bold">(obsolète)</emphasis>
+        </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
@@ -34,4 +39,16 @@ eval(Z)  // renvoie la matrice [1,0.909];
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>Historique</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0.1</revnumber>
+                <revdescription>
+                  <literal>eval()</literal> est déclarée obsolète, pour un retrait de Scilab 6.1.0.
+                  SVP la remplacer par <literal>evstr()</literal>.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index d92b1b0..2f8fc4a 100644 (file)
  *
  -->
 
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="eval" xml:lang="ja">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="eval" xml:lang="ja">
 
     <refnamediv>
 
         <refname>eval</refname>
 
-        <refpurpose>文字列の行列を評価する</refpurpose>
+        <refpurpose>文字列の行列を評価する  <emphasis role="bold">(obsolete)</emphasis>
+        </refpurpose>
 
     </refnamediv>
 
@@ -103,6 +107,18 @@ eval(Z)  //行列 [1, 0.909]を返します;
         </simplelist>
 
     </refsection>
+    <refsection role="history">
+        <title>履歴</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0.1</revnumber>
+                <revdescription>
+                  <literal>eval()</literal> is declared obsolete, to be removed from Scilab 6.1.0.
+                  Please use <literal>evstr()</literal> instead.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 
 </refentry>
 
index 35bae26..0b20412 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="eval" xml:lang="pt">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="eval" xml:lang="pt">
     <refnamediv>
         <refname>eval</refname>
-        <refpurpose>avaliação de uma matriz de strings</refpurpose>
+        <refpurpose>avaliação de uma matriz de strings  <emphasis role="bold">(obsolete)</emphasis>
+      </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
-        <title>Seqüência de Chamamento</title>
+        <title>Seqüência de Chamamento</title>
         <synopsis>[H]= eval(Z)</synopsis>
     </refsynopsisdiv>
     <refsection>
-        <title>Descrição</title>
-        <para>Retorna a avaliação da matriz de strings
+        <title>Descrição</title>
+        <para>Retorna a avaliação da matriz de strings
             <literal>Z</literal>.
         </para>
     </refsection>
@@ -35,7 +39,7 @@ a=1; b=2; Z=['a','sin(b)'] ; eval(Z)  //retorna a matriz [1,0.909];
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
-        <title>Ver Também</title>
+        <title>Ver Também</title>
         <simplelist type="inline">
             <member>
                 <link linkend="evstr">evstr</link>
@@ -45,4 +49,16 @@ a=1; b=2; Z=['a','sin(b)'] ; eval(Z)  //retorna a matriz [1,0.909];
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>Histórico</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0.1</revnumber>
+                <revdescription>
+                  <literal>eval()</literal> is declared obsolete, to be removed from Scilab 6.1.0.
+                  Please use <literal>evstr()</literal> instead.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 308f7d9..5295bae 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="eval" xml:lang="ru">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="eval" xml:lang="ru">
     <refnamediv>
         <refname>eval</refname>
-        <refpurpose>вычисление матрицы строк</refpurpose>
+        <refpurpose>
+          вычисление матрицы строк  <emphasis role="bold">(устарело)</emphasis>
+        </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Синтаксис</title>
@@ -59,4 +64,16 @@ eval(Z)  //возвращает матрицу [1, 0.909];
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>История</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0.1</revnumber>
+                <revdescription>
+                  <literal>eval()</literal> объявлена устаревшей, будет удалена из Scilab 6.1.0.
+                  Пожалуйста, вместо неё используйте <literal>evstr()</literal>.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 66d4be1..f4914d7 100644 (file)
@@ -18,6 +18,8 @@ function _h = eval(z)
     // returns the evaluation of the matrix of character strings Z.
     // Example: a=1; b=2; Z=['a','b'] ; eval(Z) returns the matrix [1,2];
 
+    warnobsolete("evstr()", "6.1");
+
     [nL,nC] = size(z);
     if nL * nC > 1 then
         L = (1:nL)'*ones(1,nC)
diff --git a/scilab/modules/string/tests/benchmarks/bench_eval.tst b/scilab/modules/string/tests/benchmarks/bench_eval.tst
deleted file mode 100644 (file)
index 6d62d72..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2016 - Scilab Enterprises - Pierre-Aimé AGNEL
-// Copyright (C) 2016 - Samuel GOUGEON <sgougeon@free.fr>
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-
-// Benchmark test for eval function
-n = 100;
-m = rand(n, n+1);
-s = string(m);
-
-// <-- BENCH NB RUN : 10 -->
-// <-- BENCH START -->
-e = eval(s);
-// <-- BENCH END -->
diff --git a/scilab/modules/string/tests/nonreg_tests/bug_7282.dia.ref b/scilab/modules/string/tests/nonreg_tests/bug_7282.dia.ref
deleted file mode 100644 (file)
index f6f5d73..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2010 - DIGITEO - Allan CORNET
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- CLI SHELL MODE -->
-// <-- Non-regression test for bug 7282 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=7282
-//
-// <-- Short Description -->
-// eval failed on some functions without output arguments.
-errmsg = msprintf(gettext("%s: Wrong number of output argument(s): %d expected.\n"), "realtimeinit", 0);
-str = "realtimeinit(60)";
-assert_checkerror("eval(str)", errmsg);
-function o = blabla()
-    o = 3;
-endfunction
-r = eval("blabla()");
-if r <> 3 then bugmes();quit;end
index db8da10..92491e8 100644 (file)
@@ -6,6 +6,7 @@
 // =============================================================================
 
 // <-- CLI SHELL MODE -->
+// <-- NO CHECK REF -->
 // <-- Non-regression test for bug 7282 -->
 //
 // <-- Bugzilla URL -->
index 865c7f6..e93321d 100644 (file)
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="xcos_simulate">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:id="xcos_simulate">
     <refnamediv>
         <refname>xcos_simulate</refname>
         <refpurpose>Function for running xcos simulation in batch mode</refpurpose>
@@ -183,8 +186,8 @@ function post_xcos_simulate(%cpr, scs_m, needcompile)
     // Retrieve exprs
     exprs = clrBlock.graphics.exprs;
     s = poly(0,'s');
-    num = eval(exprs(1));
-    den = eval(exprs(2));
+    num = evstr(exprs(1));
+    den = evstr(exprs(2));
     h = syslin('c', num/den);
     // Open new figure then plot Bode
     scf(max(winsid())+1);
@@ -231,8 +234,8 @@ function continueSimulation = pre_xcos_simulate(scs_m, needcompile)
     // Retrieve exprs
     exprs = clrBlock.graphics.exprs;
     s = poly(0,'s');
-    num = eval(exprs(1));
-    den = eval(exprs(2));
+    num = evstr(exprs(1));
+    den = evstr(exprs(2));
     h = syslin('c', num/den);
     // Open new figure then plot Bode
     scf(max(winsid())+1);
@@ -254,19 +257,19 @@ xcos_simulate(scs_m, 4);
                 <link linkend="scicos_diagram">scs_m structure</link>
             </member>
             <member>
-                <link linkend="importXcosDiagram"> importXcosDiagram</link>
+                <link linkend="importXcosDiagram">importXcosDiagram</link>
             </member>
             <member>
-                <link linkend="scicosim">scicosim: xcos batch simulation function</link>
+                <link linkend="scicosim">scicosim</link>
             </member>
             <member>
-                <link linkend="xcos">xcos: Block diagram editor and GUI for the hybrid simulator</link>
+                <link linkend="xcos">xcos</link>
             </member>
             <member>
-                <link linkend="steadycos">steadycos: Finds an equilibrium state of a Xcos diagram</link>
+                <link linkend="steadycos">steadycos</link>
             </member>
             <member>
-                <link linkend="lincos">lincos: Constructs by linearization a linear state-space model from a Xcos diagram</link>
+                <link linkend="lincos">lincos</link>
             </member>
         </simplelist>
     </refsection>
index 6946781..7d4f2c4 100644 (file)
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="xcos_simulate" xml:lang="ja">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:id="xcos_simulate" xml:lang="ja">
     <refnamediv>
         <refname>xcos_simulate</refname>
         <refpurpose>xcosシミュレーションをバッチモードで実行する関数</refpurpose>
@@ -163,8 +166,8 @@ function post_xcos_simulate(%cpr, scs_m, needcompile)
     // exprsを取得
     exprs = clrBlock.graphics.exprs;
     s = poly(0,'s');
-    num = eval(exprs(1));
-    den = eval(exprs(2));
+    num = evstr(exprs(1));
+    den = evstr(exprs(2));
     h = syslin('c', num/den);
     // 新たに図をオープンし,ボード線図をプロット
     scf(max(winsid())+1);
@@ -205,8 +208,8 @@ function continueSimulation = pre_xcos_simulate(scs_m, needcompile)
     // exprsを取得
     exprs = clrBlock.graphics.exprs;
     s = poly(0,'s');
-    num = eval(exprs(1));
-    den = eval(exprs(2));
+    num = evstr(exprs(1));
+    den = evstr(exprs(2));
     h = syslin('c', num/den);
     // 新しい図を開き,ボード線図をプロット
     scf(max(winsid())+1);
@@ -225,19 +228,19 @@ xcos_simulate(scs_m, 4);
                 <link linkend="scicos_diagram">scs_m 構造体</link>
             </member>
             <member>
-                <link linkend="importXcosDiagram"> importXcosDiagram</link>
+                <link linkend="importXcosDiagram">importXcosDiagram</link>
             </member>
             <member>
-                <link linkend="scicosim">scicosim: xcos バッチシミュレーション関数</link>
+                <link linkend="scicosim">scicosim</link>
             </member>
             <member>
-                <link linkend="xcos">xcos: ハイブリッドシミュレータ用のブロックダイアグラムエディタ及びGUI</link>
+                <link linkend="xcos">xcos</link>
             </member>
             <member>
-                <link linkend="steadycos">steadycos: xcosダイアグラムの定常状態を見つける</link>
+                <link linkend="steadycos">steadycos</link>
             </member>
             <member>
-                <link linkend="lincos">lincos: xcosダイアグラムから線形化により線形状態空間モデルを構築する</link>
+                <link linkend="lincos">lincos</link>
             </member>
         </simplelist>
     </refsection>