%b|s_#_s|b() overloads moved => [overloading] 22/21622/4
Samuel GOUGEON [Thu, 12 Nov 2020 01:53:10 +0000 (02:53 +0100)]
 All these overloads have been tested to get their actual status:

* The following are now no longer called (hard-coded):
  %b_a_b(+), %b_s_b(-), %b_x_b(.*)  => removed

* All other comitted ones are still called. They are used now for more
  than 10 years in a transparent way by all users. So they can be
  considered as native, no longer only for compatibility reasons.
  => proposal to move them in [overloading]:

 - Only when s is complex:
  %b_a_s(+), %b_s_s(-), %b_d_s(./), %b_x_s(.*),
  %s_a_b,    %s_s_b,    %s_d_b(./), %s_x_b(.*)

  - When s is real or complex:
  %b_c_s([,]), %b_f_s([;]), %b_l_s,    %b_p_s(^), %b_r_s,   %b_l_b(\)
  %s_c_b([,]), %s_f_b([;]), %s_l_b(\), %s_p_b(^), %s_r_b(/), %b_r_b(/)

  %b_l_b and %b_r_b could be moved to [boolean] instead of [overloading],
  but they would then be alone in booleanlib.

Change-Id: I31ee365958c075e136a3a7b2ef184cee4acdd761

23 files changed:
scilab/modules/m2sci/macros/compat_functions/%b_a_b.sci [deleted file]
scilab/modules/m2sci/macros/compat_functions/%b_s_b.sci [deleted file]
scilab/modules/m2sci/macros/compat_functions/%b_x_b.sci [deleted file]
scilab/modules/overloading/macros/%b_a_s.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_a_s.sci with 91% similarity]
scilab/modules/overloading/macros/%b_c_s.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_c_s.sci with 95% similarity]
scilab/modules/overloading/macros/%b_d_s.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_d_s.sci with 91% similarity]
scilab/modules/overloading/macros/%b_f_s.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_f_s.sci with 95% similarity]
scilab/modules/overloading/macros/%b_l_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_l_b.sci with 94% similarity]
scilab/modules/overloading/macros/%b_l_s.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_l_s.sci with 91% similarity]
scilab/modules/overloading/macros/%b_p_s.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_p_s.sci with 96% similarity]
scilab/modules/overloading/macros/%b_r_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_r_b.sci with 90% similarity]
scilab/modules/overloading/macros/%b_r_s.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_r_s.sci with 96% similarity]
scilab/modules/overloading/macros/%b_s_s.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_s_s.sci with 96% similarity]
scilab/modules/overloading/macros/%b_x_s.sci [moved from scilab/modules/m2sci/macros/compat_functions/%b_x_s.sci with 92% similarity]
scilab/modules/overloading/macros/%s_a_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%s_a_b.sci with 91% similarity]
scilab/modules/overloading/macros/%s_c_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%s_c_b.sci with 91% similarity]
scilab/modules/overloading/macros/%s_d_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%s_d_b.sci with 91% similarity]
scilab/modules/overloading/macros/%s_f_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%s_f_b.sci with 95% similarity]
scilab/modules/overloading/macros/%s_l_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%s_l_b.sci with 96% similarity]
scilab/modules/overloading/macros/%s_p_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%s_p_b.sci with 96% similarity]
scilab/modules/overloading/macros/%s_r_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%s_r_b.sci with 96% similarity]
scilab/modules/overloading/macros/%s_s_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%s_s_b.sci with 96% similarity]
scilab/modules/overloading/macros/%s_x_b.sci [moved from scilab/modules/m2sci/macros/compat_functions/%s_x_b.sci with 88% similarity]

diff --git a/scilab/modules/m2sci/macros/compat_functions/%b_a_b.sci b/scilab/modules/m2sci/macros/compat_functions/%b_a_b.sci
deleted file mode 100644 (file)
index 7fe8432..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ???? - INRIA - Scilab
-//
-// Copyright (C) 2012 - 2016 - Scilab Enterprises
-//
-// This file is hereby licensed under the terms of the GNU GPL v2.0,
-// pursuant to article 5.3.4 of the CeCILL v.2.1.
-// This file was originally licensed under the terms of the CeCILL v2.1,
-// and continues to be available under such terms.
-// For more information, see the COPYING file which you should have received
-// along with this program.
-
-function r=%b_a_b(a,b)
-    r=bool2s(a)+bool2s(b)
-endfunction
diff --git a/scilab/modules/m2sci/macros/compat_functions/%b_s_b.sci b/scilab/modules/m2sci/macros/compat_functions/%b_s_b.sci
deleted file mode 100644 (file)
index 177fefe..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ???? - INRIA - Scilab
-//
-// Copyright (C) 2012 - 2016 - Scilab Enterprises
-//
-// This file is hereby licensed under the terms of the GNU GPL v2.0,
-// pursuant to article 5.3.4 of the CeCILL v.2.1.
-// This file was originally licensed under the terms of the CeCILL v2.1,
-// and continues to be available under such terms.
-// For more information, see the COPYING file which you should have received
-// along with this program.
-
-function r=%b_s_b(a,b)
-    r=bool2s(a)-bool2s(b)
-endfunction
diff --git a/scilab/modules/m2sci/macros/compat_functions/%b_x_b.sci b/scilab/modules/m2sci/macros/compat_functions/%b_x_b.sci
deleted file mode 100644 (file)
index d3ce58b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ???? - INRIA - Scilab
-//
-// Copyright (C) 2012 - 2016 - Scilab Enterprises
-//
-// This file is hereby licensed under the terms of the GNU GPL v2.0,
-// pursuant to article 5.3.4 of the CeCILL v.2.1.
-// This file was originally licensed under the terms of the CeCILL v2.1,
-// and continues to be available under such terms.
-// For more information, see the COPYING file which you should have received
-// along with this program.
-
-function r=%b_x_b(a,b)
-    r=bool2s(a).*bool2s(b)
-endfunction
@@ -10,6 +10,6 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function r=%b_a_s(a,b)
-    r=bool2s(a)+b
+function r = %b_a_s(b, s)
+    r = [bool2s(b), s]
 endfunction
@@ -11,5 +11,5 @@
 // along with this program.
 
 function r=%b_c_s(b,s)
-    r=[bool2s(b),s]
+    r = [bool2s(b), s]
 endfunction
@@ -10,6 +10,6 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function r=%b_d_s(a,b)
-    r=bool2s(a)./b
+function r = %b_d_s(a, b)
+    r = bool2s(a) ./ b
 endfunction
@@ -11,5 +11,5 @@
 // along with this program.
 
 function r=%b_f_s(b,s)
-    r=[bool2s(b);s]
+    r = [bool2s(b) ; s]
 endfunction
@@ -11,5 +11,5 @@
 // along with this program.
 
 function r=%b_l_b(a,b)
-    r=bool2s(a)\bool2s(b)
+    r = bool2s(a) \ bool2s(b)
 endfunction
@@ -10,6 +10,6 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function r=%b_l_s(a,b)
-    r=bool2s(a)\b
+function r = %b_l_s(a, b)
+    r = bool2s(a) \ b
 endfunction
@@ -12,5 +12,5 @@
 
 function r=%b_p_s(a,b)
     // Copyright INRIA
-    r=bool2s(a)^b
+    r = bool2s(a)^b
 endfunction
@@ -10,6 +10,6 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function r=%b_r_b(a,b)
-    r=bool2s(a)/bool2s(b)
+function r = %b_r_b(a, b)
+    r = bool2s(a) / bool2s(b)
 endfunction
@@ -11,5 +11,5 @@
 // along with this program.
 
 function r=%b_r_s(a,b)
-    r=bool2s(a)/b
+    r = bool2s(a) / b
 endfunction
@@ -11,5 +11,5 @@
 // along with this program.
 
 function r=%b_s_s(a,b)
-    r=bool2s(a)-b
+    r = bool2s(a) - b
 endfunction
@@ -11,7 +11,7 @@
 // along with this program.
 
 function r=%b_x_s(a,b)
-    A=zeros(a)
-    A(a)=1
-    r=A.*b
+    A = zeros(a)
+    A(a) = 1
+    r = A .* b
 endfunction
@@ -10,7 +10,7 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function r=%s_a_b(a,b)
+function r = %s_a_b(a, b)
     // Copyright INRIA
-    r=a+bool2s(b)
+    r = a + bool2s(b)
 endfunction
@@ -10,6 +10,6 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function r=%s_c_b(s,b)
-    r=[s bool2s(b)]
+function r = %s_c_b(s, b)
+    r = [s bool2s(b)]
 endfunction
@@ -10,6 +10,6 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function r=%s_d_b(a,b)
-    r=a./bool2s(b)
+function r = %s_d_b(a, b)
+    r = a ./ bool2s(b)
 endfunction
@@ -11,5 +11,5 @@
 // along with this program.
 
 function r=%s_f_b(s,b)
-    r=[s;bool2s(b)]
+    r = [s ; bool2s(b)]
 endfunction
@@ -11,5 +11,5 @@
 // along with this program.
 
 function r=%s_l_b(a,b)
-    r=a\bool2s(b)
+    r = a \ bool2s(b)
 endfunction
@@ -11,5 +11,5 @@
 // along with this program.
 
 function r=%s_p_b(a,b)
-    r=a^bool2s(b)
+    r = a ^ bool2s(b)
 endfunction
@@ -11,5 +11,5 @@
 // along with this program.
 
 function r=%s_r_b(a,b)
-    r=a/bool2s(b)
+    r = a / bool2s(b)
 endfunction
@@ -11,5 +11,5 @@
 // along with this program.
 
 function r=%s_s_b(a,b)
-    r=a-bool2s(b)
+    r = a - bool2s(b)
 endfunction
@@ -10,8 +10,8 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function r=%s_x_b(a,b)
-    B=zeros(b)
-    B(b)=1
-    r=a.*B
+function r = %s_x_b(a, b)
+    B = zeros(b)
+    B(b) = 1
+    r = a .* B
 endfunction