[mercury-users] 3 new questions

Ralph Becket rafe at cs.mu.OZ.AU
Sat Feb 21 12:13:17 AEDT 2004


Dieter B?ttner, Friday, 20 February 2004:
> Hello,
> 
> maybe the more experienced mercury user can help:
> I am using mercury 0.11.1_beta_2004_02_12-1, installed via rpm on SuSE 
> professional 9.0.
> 
> 1. Is it true, that with Mercury I don't need to pay attention for
> programming tail-recursive, because the compiler will rearrange the
> code and make it tail-recursive?  

The compiler supports the following flags:

        --introduce-accumulators
                Attempt to introduce accumulating variables into
                procedures, so as to make them tail recursive.
        --optimize-constructor-last-call
                Enable the optimization of "last" calls that are followed by
                constructor application.

Tail call optimization depends upon the grade and target language.  In
the asm_fast grades you do get full tail call optimization; in the high
level grades you get TCO for immediate tail recursion, but not
necessarily for indirect tail recursion.

I'll try to find decent answers to your other two questions soon...

-- Ralph
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list