(setq al
(list
'(45 45) '(45)
'(34 34) '(34)
'(23 23 23 23)
'(12 12 12 12 12) '(12 12 12 12) '(12 12 12) '(12 12) '(12)
)
)
_$ (lst< al 100)
(
((45) (34) (12))
((45) (12 12 12) (12))
((45) (12 12) (12))
((34) (12 12 12 12) (12))
((34) (12 12 12) (12 12))
((34) (12 12 12) (12))
((34) (12 12) (12))
((12 12 12 12 12) (12 12) (12))
((12 12 12 12) (12 12 12) (12))
((12 12 12 12) (12 12) (12))
((12 12 12) (12 12) (12))
((45) (34))
((45) (12 12 12 12))
((45) (12 12 12))
((45) (12 12))
((45) (12))
((34 34) (12 12))
((34 34) (12))
((34) (12 12 12 12 12))
((34) (12 12 12 12))
((34) (12 12 12))
((34) (12 12))
((34) (12))
((12 12 12 12 12) (12 12 12))
((12 12 12 12 12) (12 12))
((12 12 12 12 12) (12))
((12 12 12 12) (12 12 12))
((12 12 12 12) (12 12))
((12 12 12 12) (12))
((12 12 12) (12 12))
((12 12 12) (12))
((12 12) (12))
((45 45))
((45))
((34 34))
((34))
((23 23 23 23))
((12 12 12 12 12))
((12 12 12 12))
((12 12 12))
((12 12))
((12))
)
I'm too lazy to evaluate those assignments, but I'm pretty sure you'll get an error ... something like missing or bad function ...Yep, correct. There are too many parentheses in there. A very good reason for using a decent editor. The OP's code should look like this instead:
added: addressed to the OP.
_$ a1
(((45 45) (45)) ((34 34) (34)) ((23 23 23 23) (23 23 23) (23 23) (23)) ((12 12 12 12 12 12 12 12) (12 12 12 12 12 12 12) (12 12 12 12 12 12) (12 12 12 12 12) (12 12 12 12) (12 12 12) (12 12) (12)))
_$ a2
100
Now is there a reason you have them in sub-lists? Should the permutations only happen between these? Or should some combinations also occur between items in the same sublist, e.g.:(12 12) + (12)
Sorry, from samples this is unclear. If this is allowable, then making it slightly simpler would be to append all the sublists (i.e. flatten) into one list like so:_$ (apply 'append a1)
((45 45) (45) (34 34) (34) (23 23 23 23) (23 23 23) (23 23) (23) (12 12 12 12 12 12 12 12) (12 12 12 12 12 12 12) (12 12 12 12 12 12) (12 12 12 12 12) (12 12 12 12) (12 12 12) (12 12) (12))
Else the combinations become slightly more complex.