Skip to content

enable %l_p for %l_string %st_string overloads

Samuel GOUGEON requested to merge sgougeon/scilab:MR368_%l_p_varargout into main

After !236 (merged) and #16940 (closed) (#16940 (comment 1300886461)), enabling %l_p() to output what by default it displays
will allow to add (in a separate MR) to the string page some trivial examples of %l_string() and %st_string() implementations.

function t = %l_string(L)
    t = %l_p(L)
endfunction
L = list([3 %i],,"abc", list("cde",,rand(1,3)),(1-%z)^2, [%t %f]);
string(L)
--> string(L)
 ans  =
  "(1) = [3,%i]"                            
  "(2) = (void)"                            
  "(3) = "abc""                             
  "(4) : list:"                             
  "    (1) = "cde""                         
  "    (2) = (void)"                        
  "    (3) = [0.068374,0.5608486,0.6623569]"
  "(5) = 1-2*%z+%z^2"                       
  "(6) = [%t,%f]"                           
function t = %st_string(st)
    t = %l_p(st)
endfunction

L = list([3 %i],,"abc", list("cde",,rand(1,3)), [%t %f]);
s = struct("num",1:4,"pol",[%z 1-%z^2], "txt",["a" "bc" "def"], "liste",L, "bool",[%T %F %T]);
string(s)
Edited by Samuel GOUGEON

Merge request reports