further development of httpserver
This commit is contained in:
parent
a58a2f3823
commit
a830367996
47 changed files with 102 additions and 29 deletions
17
examples/allany.nim
Executable file
17
examples/allany.nim
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
# All and any
|
||||
|
||||
template all(container, cond: expr): expr =
|
||||
block:
|
||||
var result = true
|
||||
for item in items(container):
|
||||
if not cond(item):
|
||||
result = false
|
||||
break
|
||||
result
|
||||
|
||||
if all("mystring", {'a'..'z'}.contains):
|
||||
echo "works"
|
||||
else:
|
||||
echo "does not work"
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue