PageRenderTime 38ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/samples/closure/closure3.ooc

http://github.com/nddrylliog/oc
Unknown | 9 lines | 6 code | 3 blank | 0 comment | 0 complexity | c8b32b7067c07224f4688f4fa80be926 MD5 | raw file
  1. printf: extern func
  2. gen: func (i: int) -> Func -> int {
  3. func -> int { i }
  4. }
  5. f1 := gen(42)
  6. printf("%d\n", f1())