Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Iterators and looping over these. #685

Open
kiljacken opened this issue Feb 9, 2016 · 5 comments
Open

Iterators and looping over these. #685

kiljacken opened this issue Feb 9, 2016 · 5 comments

Comments

@kiljacken
Copy link
Member

What's our plan for this?

@felixangell
Copy link
Member

As discussed on IRC, I'm pretty happy for this to be in the standard library or runtime as an interface.

@MovingtoMars
Copy link
Member

How about:

type Iterator interface<T> {
    func iterate<T>() (T, bool), // returns false once the iterator is done
}

@kiljacken
Copy link
Member Author

I like that, but why not use Option<T> as return?

On Fri, 12 Feb 2016 06:50 Liam [email protected] wrote:

How about:

type Iterator interface {
func iterate() (T, bool), // returns false once the iterator is done
}


Reply to this email directly or view it on GitHub
#685 (comment).

@MovingtoMars
Copy link
Member

sounds good

@felixangell
Copy link
Member

Ye LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants