Those are different cases. My examples have single argument and allow for
dynamic len at runtime. Yours have multiple and have to hard code it.
This would have been more relevant :
function join( arr, sp="", _ret="", _i=0)=
(
_i<len(arr)?
join( arr, sp=sp
, _ret= str(_ret,_i==0?"":sp,arr[_i])
, _i=_i+1 )
:_ret
);
join( [2,3,4] )= "234"
join( [2,3,4], "|" )= "2|3|4"
join( [2,[5,1],"a"], "/" )= "2/[5, 1]/a"
join( [], "|" )= ""
$ Runsun Pan, PhD
$ -- libs: doctest , faces ( git ), offliner ( git );
ideas: hash ( 1 , 2 ), sweep
$ -- Linux Mint 17.1 Rebecca x64 + OpenSCAD 2015.03.15/2015.04.01.nightly
--
View this message in context: http://forum.openscad.org/Proposed-concat-improvement-tp13283p13304.html
Sent from the OpenSCAD mailing list archive at Nabble.com.