Tutorial by Examples

def count = 0 nonmemoized = { long n -> println "nonmemoized: $n"; count++ } nonmemoized(1) nonmemoized(2) nonmemoized(2) nonmemoized(1) assert count == 4 def mcount = 0 memoized = { long n -> println "memoized: $n"; mcount++ }.memoize() memoized(1) me...

Page 1 of 1