-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
#test.nim
import iterutils
from sequtils import toSeq
import sugar
proc test1()=
for i in filter(map(filter(2..10, proc(x: int): bool = x mod 2 == 0),
proc(x: int): int = x * 2), proc(x: int): bool = x mod 8 == 0):
echo i
var s = toSeq (2..10).filter(proc(x): bool = x mod 2 == 0).
map(proc(x): int = x * 2).filter(proc(x): bool = x mod 8 == 0)
echo s
var a = (2..10).filter(proc(x: int): bool = x mod 2 == 0)
var b = a.map((x: int) => x * 2)
for i in b.map((x: int) => x + 2):
echo i
test1()
gives:
test.nim(19, 17) Error: invalid indentation
fixing that gives other errors, and nothing prints
This example should be a test file in this repo so others can fix it (ideally something ran by nimble test iterutils
)
links
Metadata
Metadata
Assignees
Labels
No labels