atom feed2 messages in com.marklogic.developer.general[MarkLogic Dev General] Ensuring That...
FromSent OnAttachments
Eliot KimberNov 11, 2017 3:24 pm 
Dave CasselNov 12, 2017 6:04 am 
Subject:[MarkLogic Dev General] Ensuring That Tail Recursion Optimization Will Be Applied
From:Eliot Kimber (ekim@contrext.com)
Date:Nov 11, 2017 3:24:32 pm
List:com.marklogic.developer.general

ML 9

I’m using recursive functions to process an arbitrarily large set of items where
in a procedural language I would use a while true() loop. The number of items
can be large so tail recursion optimization has to be in place or I’ll
eventually blow the call stack.

My question: How do I ensure that my functions are constructed so that tail
recursion optimization will be applied?

A search on “recursion” or “tail recursion” didn’t reveal anything on the ML
docs site.

Thanks,

Eliot