There is kind of a way to compose iterators.
    
    
    template `!`[T](it: iterable[T]): untyped =
      (iterator(): T =
        for i in it: yield i)
    
    iterator double(it: iterator(): int): int =
      for i in it():
        yield 2 * i
    
    for i in double(!double(!(1..3))):
      echo i
    
    
    Run

This gives a segmentation fault but I can't fix it right now as I am on mobile 
and walking, it might work if you don't use `iterable[T]`

Reply via email to