title: Prolog: Delete last list element
body: <p>I succeeded to reverse a list:</p>
  
  <pre><code>reverse([],Z,Z).
  reverse([H|T],Z,A) :- reverse(T,Z,[H|A]).
  </code></pre>
  
  <p>and I want a program that deletes the last element of a list.</p>