title: How do you show the contents of a list in prolog?
body: <p>I have the following code:</p>
  
  <pre><code> born(person1,1991).
  
   born(person2,1965).
  
   born(person3,1966).
  
   born(person4,1967).
  
   born(person5,1968).
  
   born(person6,1969).
  
  
   criteria(X,Y):- born(X,Z) , born(Y,T) , Z&lt;T.
   order([]).  
  
   order([X]).  
  
   order([X,Y|L]) :- criteria(X,Y),order([Y|L]). 
  </code></pre>
  
  <p>I have the predicate order([X,Y|L) that is true if the list is ordered , in this case, the first element should be the oldest person and the last element should be the youngest person.</p>
  
  <p>My question is: how would you do a predicate print_List/1 that allows you to print the content of a list . An example of how it should work would be:</p>
  
  <pre><code>  ?-print_List([X]).
    X = [person2, person3, person4, person5, person6, person1)
  </code></pre>