PageRenderTime 81ms CodeModel.GetById 40ms app.highlight 0ms RepoModel.GetById 40ms app.codeStats 0ms

/samples/closure/while1.ooc

http://github.com/nddrylliog/oc
Unknown | 13 lines | 10 code | 3 blank | 0 comment | 0 complexity | 1e5a0a6f2b85d1cba9bd07107f96b848 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(|| 1, ||
12    printf("%s\n", "Hi there!")
13)