tcl : get all elements combinations from an input list of lists

Status
Not open for further replies.

pierre13

Junior Member level 3
Joined
Aug 9, 2012
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,725
Hello,

I would like to implement a Tcl code to get all the combination of elements of an input list of lists, such as :

set combi_list { {a b {c1 c2}} {d {e1 e2 e3} f g} {h {i1 i2}} }

I would like to get the combinations :
a/b/c1
a/b/c2
d/e1/f/g
d/e2/f/g
d/e3/f/g
h/i1
h/i2

Of course, the number of lists in the main list is variable such as the number of elements !!
Thanks for helping me !!

P.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…