Sorry Charles, was getting ready for work when I hastilly made that post. The point I was trying to make is this ...
(defun foo1 ( lst / result )
(foreach x lst
(if SomeConditionMet
(setq result
(cons x result)
)
)
)
(reverse result)
)
(defun foo2 ( lst / result )
(foreach x (reverse lst)
(if SomeConditionMet
(setq result
(cons x result)
)
)
)
result
)
In foo1 the order of the elements in variable result is reversed from the original, hense you have to reverse its contents when returning it to the caller.
In foo2 the order of the elements in variable result is the same as the original, hense no need to reverse it when returning it to the caller.
Speaking generally, When dealing with flat lists (the norm), foo1 is preferable when the result has fewer elements than the original (the norm); foo2 prefereable when the result has more elements than the original.
However, reversing a nested list, processing it and then returning the result may not yield the desired result! </point>
But I'm not saying that's what you did, recall "Note, it's tempting to think ..."
Cheers.