I want to be able to collect multiple lists inside a loop.
I know this can be done without a loop, however I was wondering whether this would be possible with a loop as well. I'd like something like this:
(loop for var in list
(if (cond1 var)
(if (cond2 var)
collect into list1
collect into list2))
finally (list list1 list2))
I get the error that the LOOP keyword is expected
, I guess the collect should be used right after a when
or a loop
. Is there any way to solve that?