[,] concatenations with cblock have troubles
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
Some horizontal columns concatenations are defined for the tabular cblock typeof.
But there are various issues:
A) An error prevents concatenating an empty cblock table with an authorized column
-------------------------------------------------------------------------------
When it is created with msscanf(), such a table can be concatenated with a matrix of double:
--> D=msscanf(-1,["Alain 19";"Pierre 15";"Tom 12"],'%s %d')
D =
Alain 19
Pierre 15
Tom 12
--> [D (1:3)']
ans =
Alain 19 1
Pierre 15 2
Tom 12 3
But this is not possible from an empty cblock:
--> D = mlist('cblock');
--> [D (1:3)']
at line 7 of function %cblock_c_s ( SCI\modules\overloading\macros\%cblock_c_s.sci line 19 )
%cblock_c_s: Arguments #1 and #2: Incompatible sizes.
--> [(1:3)' d]
at line 3 of function %s_c_cblock ( SCI\modules\overloading\macros\%s_c_cblock.sci line 15 )
Invalid index.
B) H-concatenating a cblock object with a new column or matrix of text is not supported, while columns can already be of text from msscanf()
-----------------------------------------------------------------------------------------------------------------------------------------
--> T = msscanf(-1,["Alain 19";"Pierre 15";"Tom 12"],'%s %d');
--> T
T =
Alain 19
Pierre 15
Tom 12
--> [T ["Toulouse" "Lyon" "Nantes"]']
Undefined operation for the given operands.
check or define function %cblock_c_c for overloading.
--> [["Toulouse" "Lyon" "Nantes"]' T]
Undefined operation for the given operands.
check or define function %c_c_cblock for overloading.
C) H-concatenating a cblock object with columns or matrices of regular encoded integers or boolean is not supported
----------------------------------------------------------------------------------------------------------------
This would be welcome.
--> [T [%T %F %F]']
Undefined operation for the given operands.
check or define function %cblock_c_b for overloading.
--> [[%T %F %F]' T]
Undefined operation for the given operands.
check or define function %b_c_cblock for overloading.
--> [T int8(1:3)']
Undefined operation for the given operands.
check or define function %cblock_c_i for overloading.
--> [int8(1:3)' T]
Undefined operation for the given operands.
check or define function %i_c_cblock for overloading.
ERROR LOG:
----------
See above
HOW TO REPRODUCE THE BUG:
-------------------------
// A)
D = mlist('cblock');
[D (1:3)']
[(1:3)' D]
// B)
T = msscanf(-1,["Alain 19";"Pierre 15";"Tom 12"],'%s %d');
[T ["Toulouse" "Lyon" "Nantes"]']
[["Toulouse" "Lyon" "Nantes"]' T]
// C)
[T [%T %F %F]']
[[%T %F %F]' T]
[T int8(1:3)']
[int8(1:3)' T]
OTHER INFORMATION:
------------------
Same issues in Scilab 6.0.1