`findall/3` for collecting non ground terms

I thought S would be bound to [a(X)], but really to [a(_)]. Should be careful.

% ?- L = [a(X)], findall(A, ( member(A, L), functor(A, a, 1)),  S).
%@ L = [a(X)],
%@ S = [a(_)].
1 Like