PageRenderTime 3ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 0ms 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
 2printf: extern func
 3
 4while0: func (cond: Func -> Bool, block: Func) {
 5    cond() ifTrue(||
 6        block()
 7        while0(cond, block)
 8    )
 9}
10
11while0(func -> int { 1 }, ||
12    printf("%s\n", "Hi there!")
13)