title: Prolog replace element in a list with another list
body: <p>*Hi, i am trying to replace an element from a list with another list and im stuck when turbo prolog gives me syntax error at the case where if C=A-> put in result list(L1) the list that replace the element.</p>
  
  <pre><code>domains
      list=integer*
      element=i(integer);l(list)
      lista=element*
  predicates
      repl(list,integer,list,lista)
  clauses
      repl([],A,B,[]):-!.
      repl([C|L],A,B,**[l(|L1])**:- C=A,repl(L,A,B,L1),!.
      repl([C|L],A,B,[i(C)|L1]):- repl(L,A,B,L1),!.
  </code></pre>
  
  <p>Thanks for help, problem solved (using dasblinkenlight code)</p>