Skip to content

Instantly share code, notes, and snippets.

View joshuacalloway's full-sized avatar

joshua calloway joshuacalloway

View GitHub Profile
@akihiro4chawon
akihiro4chawon / Main.groovy
Created July 4, 2011 08:44
Memoization with Groovy Custom AST Tranformation
package akihiro4chawon
class Main {
@Memoize
def fib(a) {
//a <= 1 ? a : fib(a - 2) + fib(a - 1)
if (a <= 1) return a
else return fib(a - 2) + fib(a - 1)
}