Handle tail recursion in function calls: so far, recursive functions were rapidly filling the call stack,  leading to a StackOverflowException thrown by Java. This is rather bad for a functional language like  XQuery.
Handle tail recursion in function calls: so far, recursive functions were rapidly filling the call stack, 
leading to a StackOverflowException thrown by Java. This is rather bad for a functional language like 
XQuery.

eXist does now detect tail recursions and handles them by returning a DeferredFunctionCall object instead
of actually executing the function. The function is thus pushed up the stack. This works for direct as well 
as indirect recursion.

Fixes bug 1263445.

svn path=/trunk/eXist-1.0/; revision=3893

patczar/exist,wolfgangmm/exist,shabanovd/exist,lcahlander/exist,olvidalo/exist,MjAbuz/exist,RemiKoutcherawy/exist,ljo/exist,ambs/exist,olvidalo/exist,RemiKoutcherawy/exist,wshager/exist,patczar/exist,eXist-db/exist,wolfgangmm/exist,jensopetersen/exist,wshager/exist,hungerburg/exist,eXist-db/exist,opax/exist,kohsah/exist,wshager/exist,ambs/exist,MjAbuz/exist,eXist-db/exist,ljo/exist,windauer/exist,jessealama/exist,jensopetersen/exist,opax/exist,dizzzz/exist,hungerburg/exist,kohsah/exist,olvidalo/exist,hungerburg/exist,shabanovd/exist,jessealama/exist,adamretter/exist,MjAbuz/exist,windauer/exist,shabanovd/exist,jessealama/exist,windauer/exist,patczar/exist,adamretter/exist,opax/exist,RemiKoutcherawy/exist,ljo/exist,windauer/exist,joewiz/exist,joewiz/exist,eXist-db/exist,ambs/exist,olvidalo/exist,ljo/exist,lcahlander/exist,ambs/exist,olvidalo/exist,dizzzz/exist,wolfgangmm/exist,adamretter/exist,dizzzz/exist,MjAbuz/exist,windauer/exist,jensopetersen/exist,windauer/exist,patczar/exist,dizzzz/exist,eXist-db/exist,ljo/exist,adamretter/exist,zwobit/exist,lcahlander/exist,kohsah/exist,jessealama/exist,ambs/exist,RemiKoutcherawy/exist,wshager/exist,kohsah/exist,shabanovd/exist,jensopetersen/exist,joewiz/exist,patczar/exist,kohsah/exist,adamretter/exist,zwobit/exist,wolfgangmm/exist,patczar/exist,adamretter/exist,zwobit/exist,MjAbuz/exist,dizzzz/exist,eXist-db/exist,RemiKoutcherawy/exist,jessealama/exist,zwobit/exist,wshager/exist,zwobit/exist,jessealama/exist,jensopetersen/exist,wshager/exist,hungerburg/exist,ambs/exist,wolfgangmm/exist,kohsah/exist,jensopetersen/exist,lcahlander/exist,joewiz/exist,hungerburg/exist,opax/exist,joewiz/exist,wolfgangmm/exist,shabanovd/exist,joewiz/exist,shabanovd/exist,MjAbuz/exist,ljo/exist,opax/exist,dizzzz/exist,lcahlander/exist,lcahlander/exist,RemiKoutcherawy/exist,zwobit/exist