/samples/closure/closure2.ooc

http://github.com/nddrylliog/oc · Unknown · 9 lines · 6 code · 3 blank · 0 comment · 0 complexity · faaddda66af29b87e3ca3d740e19acd4 MD5 · raw file

  1. printf: extern func
  2. gen: func -> Func -> int {
  3. func -> int { 42 }
  4. }
  5. f1 := gen(42)
  6. printf("%d\n", f1())