title: Putting all results of a query in a list in Prolog
body: <p>I'd like to know how to make a predicate that puts all results obtained from some query (so I get a result and press semicolon until I get False) in a list.</p>
  
  <p>For example if I write <code>foo(X,[1,2,3]).</code> in some Prolog listener, let's say the result is</p>
  
  <pre><code>X=[11];
  X=[22];
  False.
  </code></pre>
  
  <p>I would like to get all those results in a list, so something like the following would happen.</p>
  
  <pre><code>?-another_foo(X,[1,2,3]).
  X=[[11],[22]].
  </code></pre>
  
  <p>another_foo would somehow use foo to create a list with all the results from foo.
  I just don't know how.</p>