Quick actions

cmd+k|ctrl+k

Navigation

Languages

Untitled

Snippet info

Language

Nim

Visibility

public

Author

mbarkhau

Created

2016-10-13T20:20:54Z

Updated

2016-10-13T20:20:54Z


proc allInt(elems: seq[int]): bool {.noSideEffect} =
    for elem in elems:
        if not bool(elem):
            return false
    return true


static:
    assert (not bool(0))
    assert bool(1)
    assert allInt(@[1, 2, 3, 4])
INFO