bugfixes; added events module, sequtils module

This commit is contained in:
Araq 2011-07-26 00:46:41 +02:00
commit 0e7f2ca3f1
13 changed files with 292 additions and 15 deletions

View file

@ -3,13 +3,22 @@
template all(container, cond: expr): expr =
block:
var result = true
for item in items(container):
if not cond(item):
for it in items(container):
if not cond(it):
result = false
break
result
if all("mystring", {'a'..'z'}.contains):
template any(container, cond: expr): expr =
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"