Mercurial > hg > ishara
changeset 8:f0a3d7d7a0e3
Renamed cat_sep function to catsep
author | samer |
---|---|
date | Mon, 14 Jan 2013 14:54:10 +0000 |
parents | 47cb292350f3 |
children | 45aaf9b2d7b0 |
files | general/arrutils/cat_sep.m general/arrutils/catsep.m general/tostring.m sequences/+seq/merge.m sequences/+seq/zipaccum.m sequences/+seq/zipwith.m sequences/@seq/seq.m |
diffstat | 7 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/general/arrutils/cat_sep.m Mon Jan 14 14:52:38 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -% cat_sep - Format nonempty list of string with comma separators -% cat_sep :: {[N]->string} -> string. -function s=cat_sep(sep,list) - s=list{1}; for i=2:length(list), s=[s,sep,list{i}]; end -end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/general/arrutils/catsep.m Mon Jan 14 14:54:10 2013 +0000 @@ -0,0 +1,5 @@ +% catsep - Format nonempty list of string with comma separators +% catsep :: {[N]->string} -> string. +function s=catsep(sep,list) + s=list{1}; for i=2:length(list), s=[s,sep,list{i}]; end +end
--- a/general/tostring.m Mon Jan 14 14:52:38 2013 +0000 +++ b/general/tostring.m Mon Jan 14 14:54:10 2013 +0000 @@ -6,7 +6,7 @@ % etc. % % Multiple inputs are converted to comma-separated string. - s=cat_sep(',',map(@tostr,varargin)); + s=catsep(',',map(@tostr,varargin)); end function s=tostr(x)
--- a/sequences/+seq/merge.m Mon Jan 14 14:52:38 2013 +0000 +++ b/sequences/+seq/merge.m Mon Jan 14 14:54:10 2013 +0000 @@ -35,7 +35,7 @@ function z=elsize(d), z=size(d.hd); end function s=tostring(d) - s=sprintf('{ %s } >> merge(%s)',cat_sep(',',cellmap(@tostring,d.sources)),tostring(d.fn)); + s=sprintf('{ %s } >> merge(%s)',catsep(',',cellmap(@tostring,d.sources)),tostring(d.fn)); end end end
--- a/sequences/+seq/zipaccum.m Mon Jan 14 14:52:38 2013 +0000 +++ b/sequences/+seq/zipaccum.m Mon Jan 14 14:54:10 2013 +0000 @@ -32,7 +32,7 @@ end function s=tostring(d) - s=sprintf('{%s} >> [%s]',cat_sep(',',cellmap(@tostring,d.sources)),tostring(d.fn)); + s=sprintf('{%s} >> [%s]',catsep(',',cellmap(@tostring,d.sources)),tostring(d.fn)); end end end
--- a/sequences/+seq/zipwith.m Mon Jan 14 14:52:38 2013 +0000 +++ b/sequences/+seq/zipwith.m Mon Jan 14 14:54:10 2013 +0000 @@ -28,7 +28,7 @@ end function s=tostring(d) - s=sprintf('{%s} >> %s',cat_sep(',',cellmap(@tostring,d.sources)),tostring(d.fn)); + s=sprintf('{%s} >> %s',catsep(',',cellmap(@tostring,d.sources)),tostring(d.fn)); end end
--- a/sequences/@seq/seq.m Mon Jan 14 14:52:38 2013 +0000 +++ b/sequences/@seq/seq.m Mon Jan 14 14:54:10 2013 +0000 @@ -29,7 +29,7 @@ function display(o) display(sprintf(' %s :: seq([[%s]])\n', tostring(o), ... - cat_sep(',',cellmap(@fmt_dim,num2cell(elsize(o)))))); + catsep(',',cellmap(@fmt_dim,num2cell(elsize(o)))))); function s=fmt_dim(x), if isnan(x), s='_'; else s=num2str(x); end; end end