summary refs log tree commit diff stats
path: root/examples/allany.nim
diff options
context:
space:
mode:
Diffstat (limited to 'examples/allany.nim')
-rw-r--r--examples/allany.nim26
1 files changed, 0 insertions, 26 deletions
diff --git a/examples/allany.nim b/examples/allany.nim
deleted file mode 100644
index 52a794204..000000000
--- a/examples/allany.nim
+++ /dev/null
@@ -1,26 +0,0 @@
-# All and any
-
-template all(container, cond: expr): expr {.immediate.} =
-  block:
-    var result = true
-    for it in items(container):
-      if not cond(it):
-        result = false
-        break
-    result
-
-template any(container, cond: expr): expr {.immediate.} =
-  block:
-    var result = false
-    for it in items(container):
-      if cond(it):
-        result = true
-        break
-    result
-
-if all("mystring", {'a'..'z'}.contains) and any("myohmy", 'y'.`==`):
-  echo "works"
-else:
-  echo "does not work"
-
-