Details
-
Type:
Wish
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.1-beta-2
-
Fix Version/s: None
-
Component/s: class generator
-
Labels:None
-
Number of attachments :
Description
Detect and convert tail recursion into a while loop:
#!/usr/bin/env groovy
def my_while(test, action) {
if (test()) action()
else return true
my_while(test, action)
}
count = 0;
my_test = {
return count < 1000000
}
my_while(my_test) {
count++
}
println "made it!"
Issue Links
- is depended upon by
-
GROOVY-753
complete parser
-
There is now a tail recursion annotation provided by a third party. I suggest using that one or the trampoline mechanism