import zero_functional
import strutils
when defined(case1):
# error: /Users/timothee/.nimble/pkgs/zero_functional-#head/zero_functional.nim(1675, 16) Error: internal error: proc has no result symbol
# iterNode = quote:
proc bar[T](a:T)=
echo "in bar"
for si in a():
echo si
when defined(case2):
# error
proc bar[T](a:iterator: T {.inline.})=
echo "in bar"
for si in a():
echo si
when defined(case3):
# error
proc bar(a:iterator: string {.inline.})=
echo "in bar"
for si in a():
echo si
when defined(case4):
# works
template bar[T](a:T)=
echo "in bar"
for si in a():
echo si
proc test()=
lines(stdin) --> map(it.toUpper()) --> createIter(s)
# BUG
bar(s)
# ok
for si in s(): echo si
test()
@timotheecour Among a few other fixes and enhancements I created a new version 0.2.0 that also supports creating closures as default output type (in case when normally a sequence would be created) when the compile flag
zf_iteris set. https://github.com/zero-functional/zero-functional/tree/v0.2.0#compile-flagsSo - I guess this can be closed now?