Giter Club home page Giter Club logo

Comments (3)

estebank avatar estebank commented on August 22, 2024 2

This seems like a reasonable compromise, also giving an affordance to the user to also assert a specific kind of Iterator being returned (like DoubleEndedIterator). I was trying to hide it a little bit because I was thinking it would allow us to make changes here to the returned type, for example if we ever make a new expression to consume generators and give back a non-unit value through resume, but making the returned type explicit such a change would be opt-in, which is reasonable.

from iterator_item.

dignifiedquire avatar dignifiedquire commented on August 22, 2024

When comparing with the async version, I would expect the Iterator part not to be shown, given that there is like for async fn an additional marker on the fn part:

async fn foo() -> i32 { ... }
// vs 
fn foo() -> impl Future<Output = i32> { ... }
// and iterators
fn* foo() -> i32 { ... }
// vs 
fn foo() -> impl Iterator<Item = i32> { ... }

Edit: This does unfortunately not solve the issue of the potential change of return types @estebank mentioned though.

from iterator_item.

joshtriplett avatar joshtriplett commented on August 22, 2024

@dignifiedquire

When comparing with the async version,

I don't want to reopen that particular discussion here, but: some folks, myself included, believe that should have been spelled -> impl Future<Output=T> (or perhaps -> impl Future<T>) as well. And I think that may be possible to improve upon.

@estebank Exactly.

from iterator_item.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.