PageRenderTime 35ms CodeModel.GetById 31ms RepoModel.GetById 1ms app.codeStats 0ms

/samples/closure/while0.ooc

http://github.com/nddrylliog/oc
Unknown | 13 lines | 10 code | 3 blank | 0 comment | 0 complexity | 8c8a2ba03655ba0f0ba33797f222da49 MD5 | raw file
  1. printf: extern func
  2. while0: func (cond: Func -> Bool, block: Func) {
  3. cond() ifTrue(||
  4. block()
  5. while0(cond, block)
  6. )
  7. }
  8. while0(func -> int { 1 }, ||
  9. printf("%s\n", "Hi there!")
  10. )