summary refs log tree commit diff stats
path: root/tests/closure/tfutclosure2138.nim
blob: e188340740775678dbc9a42eb70f5f99cef9e241 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
import future, sequtils

proc any[T](list: varargs[T], pred: (T) -> bool): bool =
    for item in list:
        if pred(item):
            result = true
            break

proc contains(s: string, words: varargs[string]): bool =
  any(words, (word) => s.contains(word))