@463017170 wrote:
;;;(test2 28 '(8 3 5.5 4.5 ))
;;;(8 3 5.5 4.5 2.5) x (0 1 0 0 10) = 28.0 -1
;;;(8 3 5.5 4.5 2.5) x (0 0 1 0 9) = 28.0 -2
....
I don't understand how this relates to Message 1. The "result" doesn't look anything like the result there. There's no (test2) function defined in this Topic. Where did the 2.5 added to the initial list come from in all the lower lists? Where are the second lists coming from, such as the (0 1 0 0 10)? What do the negative numbers at the ends mean? Why are there 33 result lines?
Meanwhile, I notice curious differences between @463017170's (sol1) function and @ВeekeeCZ's (:allcomb) function, using an arbitrary list of sub-lists that I built:
Command: (sol1 '((1 2 3) ("A" "B" "C" "D") (8 7)))
((7 D 1) (7 D 2) (7 D 3) (7 C 1) (7 C 2) (7 C 3) (7 B 1) (7 B 2) (7 B 3) (7 A 1) (7 A 2) (7 A 3) (8 D 1) (8 D 2) (8 D 3) (8 C 1) (8 C 2) (8 C 3) (8 B 1) (8 B 2) (8 B 3) (8 A 1) (8 A 2) (8 A 3))
((7 "D" 1) (7 "D" 2) (7 "D" 3) (7 "C" 1) (7 "C" 2) (7 "C" 3) (7 "B" 1) (7 "B" 2) (7 "B" 3) (7 "A" 1) (7 "A" 2) (7 "A" 3) (8 "D" 1) (8 "D" 2) (8 "D" 3) (8 "C" 1) (8 "C" 2) (8 "C" 3) (8 "B" 1) (8 "B" 2) (8 "B" 3) (8 "A" 1) (8 "A" 2) (8 "A" 3))
Note the two lists returned, the first one without the quotation marks around the letter items. And note the reversal of the elements in the returned sub-lists from those in the source sub-lists. But (:allcomb) seems to do what's apparently intended in Message 1 [given that an 8 followed by a right parenthesis is converted to an emoji by "the system", which I've complained about several times]:
Command: (:allcomb '((1 2 3) ("A" "B" "C" "D") (8 7)))
((1 "A" 😎 (1 "A" 7) (1 "B" 😎 (1 "B" 7) (1 "C" 😎 (1 "C" 7) (1 "D" 😎 (1 "D" 7) (2 "A" 😎 (2 "A" 7) (2 "B" 😎 (2 "B" 7) (2 "C" 😎 (2 "C" 7) (2 "D" 😎 (2 "D" 7) (3 "A" 😎 (3 "A" 7) (3 "B" 😎 (3 "B" 7) (3 "C" 😎 (3 "C" 7) (3 "D" 😎 (3 "D" 7))
Kent Cooper, AIA