An illustration.
    
    
    type
      A = ref object of RootObj
      B = ref object of A
    method m(v: A) {.base.} = echo "mA"
    method m(v: B) = echo "mB"
    proc p(v: A) = echo "pA"
    proc p(v: B) = echo "pB"
    iterator items(v: A): string = yield "iA"
    iterator items(v: B): string = yield "iB"
    
    var b: A = B()
    m b # => mB
    p b # => pA
    for i in b: echo i # => iA
    
    
    Run

No corresponding language feature to combine both behaviours, of method and of 
iterator. 

Reply via email to