Hi,

I'm trying to choose dynamically which iterator to use, so I'm using class
inheritance with iterators inside them, like this:

class Abstract {
        iter Iterator(limit: int) {
            yield 0;
        }
    }


    class Concrete : Abstract {
        iter Iterator(limit: int) {
            yield 1;
        }
    }

But if I write
var myclass : Abstract = new Concrete();

myclass.Iterator(n) yields 0 instead of 1.

Is there something I'm missing? Isn't Iterator supposed to get overriden?

Thanks.

-- 
Victor Chaves
Engenharia de Computação
Instituto Militar de Engenharia
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to