bugfixes; added events module, sequtils module
This commit is contained in:
parent
3ac9012361
commit
0e7f2ca3f1
13 changed files with 292 additions and 15 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue