title: Prolog, working my way through some examples
body: <p>I'm working through some Prolog tutorials (nothing better to do and I found out earlier this week I quite like programming, so I'm working through some paradigms) and got to an exercise asking me to write a predicate delete_from_list/3 which removes all given occurences from a list.</p>
  
  <p>I've solved this as follows:</p>
  
  <pre><code>delete_from_list([], _, []).
  delete_from_list([Ah|At], X, [Ah|Bt]) :- Ah \= X, !, delete_from_list(At, X, Bt).
  delete_from_list([_|Ct], X, Bt) :- delete_from_list(Ct, X, Bt).
  </code></pre>
  
  <p>What I'm wondering though, and this might be more aesthetic than practical purpose. How would you guys do this in another way? And why?
  This mostly to gain a broader understanding of ways of problem solving in prolog :)
  For example, could this be done in 1 rule?  </p>