[mercury-users] map is not tail-recursive

Peter Ross pro at missioncriticalit.com
Tue Mar 28 22:52:02 AEDT 2006

On Tue, Mar 28, 2006 at 12:20:50PM +1100, Julien Fischer wrote:
> On Sat, 25 Mar 2006, Michael Day wrote:
> > Map is not tail-recursive. This means that applying map to a long list
> > will lead to a stack overflow, which sucks.
> >
> > Is this something that can be fixed, either by an optimisation to
> > introduce an accumulator argument or by explicitly writing it like this:
> In the case of map, compiling with `--optimize-constructor-last-call',
> ought to help.
Note you need a rotd from around december for this to work.
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