Sha256: 834f3c0ba9e6e5f8512ef51084cd93a8d909a1258fef253b2a8481f32b13a314
Contents?: true
Size: 462 Bytes
Versions: 9
Compression:
Stored size: 462 Bytes
Contents
# closure.fy # Example of closures in fancy # method that returns a closure def create_counter: number { closure = { number = number + 1 } closure } # create a counter from 100 upwards closure = create_counter: 100 # this will print numbers 100 - 120 20 times: { Console println: $ closure call } # create a counter from 500 upwards closure = create_counter: 500 # this will print numbers 500 - 510 10 times: { Console println: $ closure call }
Version data entries
9 entries across 9 versions & 1 rubygems